|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub Del_删除选定区域的空单元格() '或者删除整行
- On Error Resume Next
- Dim response$, rng As Range
- Set rng = Application.InputBox("输入空行所在的列", Title:="输入", Type:=8)
- If rng Is Nothing Then Exit Sub
- response = MsgBox("删除整行选择【是】,删除单个单元格选择【否】", vbYesNoCancel, Title:="选择")
- Select Case response
- Case Is = vbYes
- rng.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
- Case Is = vbNo
- rng.SpecialCells(xlCellTypeBlanks).Delete shift:=xlUp
- Case Is = vbCancel
- End Select
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|