删除多行列表格的快捷键(excel怎么删除多行多列)
导语:【实例10-删除多行多列】Excel表格VBA编程实例 代码分享
清空参数
Private Sub CommandButton清空参数_Click()
With ThisWorkbook.Worksheets()
.UsedRange.ClearFormats
.UsedRange.ClearContents
End With
End Sub
删除列
Private Sub CommandButton删除列_Click()
操作界面CC参数不能为空&39;定义变量
Dim wbname As String
Dim shname As String
wbname = Trim(.Cells(2, ).Value)
shname = Trim(.Cells(6, ).Value)
End With
删除行列&39;获得数据区域最大行号
Dim cmax As Long
cmax = .UsedRange.Cells(.UsedRange.Count).Column
&39;删除列
End If
Next i
End With
Workbooks(wbname).Save
MsgBox
Workbooks(wbname).Activate
ActiveWindow.WindowState = xlMaximized
Workbooks(wbname).Worksheets(shname).Activate
Workbooks(wbname).Worksheets(shname).Cells(1, 1).Select
Exit Sub
处理出错:
MsgBox Err.Description
End Sub
删除行
Private Sub CommandButton删除行_Click()
操作界面CC参数不能为空&39;定义变量
Dim wbname As String
Dim shname As String
wbname = Trim(.Cells(2, ).Value)
shname = Trim(.Cells(6, ).Value)
End With
删除行列&39;获得数据区域最大行号
Dim rmax As Long
rmax = .UsedRange.Cells(.UsedRange.Count).Row
&39;删除行
End If
Next i
End With
Workbooks(wbname).Save
MsgBox
Workbooks(wbname).Activate
ActiveWindow.WindowState = xlMaximized
Workbooks(wbname).Worksheets(shname).Activate
Workbooks(wbname).Worksheets(shname).Cells(1, 1).Select
Exit Sub
处理出错:
MsgBox Err.Description
End Sub
免责声明:本站部份内容由优秀作者和原创用户编辑投稿,本站仅提供存储服务,不拥有所有权,不承担法律责任。若涉嫌侵权/违法的,请反馈,一经查实立刻删除内容。本文内容由快快网络小思创作整理编辑!