vba删除所有excel中的一列
自己看看哪种合适罗。
Sub eraseSingleLine() '去除目录下所有XLS档案内所有Sheet中指定"横行"
Dim exPath As String, exFile As String, sht As Worksheet, iRow As Long
iRow = 4 '指定删除行号
exPath = "C:\temp" '指定路径
exFile = Dir(exPath & "*.xls") '找寻第一个档案
Do While exFile <> "" '执行回圈,无档案离开
Workbooks.Open exPath & exFile '开启XLS档案
For Each sht In ActiveWorkbook.Sheets
sht.Rows(iRow).Delete '移除整横行
' sht.Rows(iRow).Clear '清除整横行内容
Next 'sht
' ActiveWorkbook.Save '储存变更(建议先Mark起来看看效果)
ActiveWorkbook.Close '关闭档案
exFile = Dir '寻找下一个档案
Loop
End Sub