如果您指定要删除的所选单元格已从下拉列表中填写了部分#,那么我的代码就能完美运行。
但是如果你键入一个新的或自定义的#然后想删除那个部分#稍后宏返回一个
类型不匹配(错误13)
Sub DeleteRows()
Application.ScreenUpdating = False
On Error GoTo whoa
If ActiveCell.Row <= 8 Then
MsgBox "Ooops!" & vbNewLine & _
vbNewLine & "Please select a Part Number"
ElseIf MsgBox("Are you sure you want to delete this part?" & vbNewLine & _
vbNewLine & _
ActiveCell.EntireRow.Cells(1, "A").Value & vbNewLine & _
ActiveCell.EntireRow.Cells(1, "B").Value & vbNewLine & _
"QTY: " & ActiveCell.EntireRow.Cells(1, "M").Value, _
vbYesNo) = vbYes Then
ActiveCell.Resize(3, 1).EntireRow.Delete
End If
Application.ScreenUpdating = True
Exit Sub
whoa:
MsgBox "Please select a number from the drop down list" & vbNewLine & _
"then run the delete command again.", vbInformation, Err.Description
End Sub
如果我输入自定义#,如何摆脱该错误并仍然删除3行(每个部分为3行)。
由于