不管你工作簿有多少个工作表,所有工作表只保留第一行是吧!
Sub test()
Dim i As Long
Application.ScreenUpdating = False
For i = 1 To Sheets.Count
Sheets(i).Rows("2:" & Rows.Count).Clear
Next i
Application.ScreenUpdating = True
End Sub
hx95华夏联盟
如果您指的[第一行]是[A1:A...],那您需要的代码可以是:
Sub yyTEST()
Dim yiSID As Integer
For yiSID = 1 To Sheets.Count
Sheets(yiSID).Activate
Range(Cells(2, 1), Cells(Rows.Count, Columns.Count)).ClearContents
Next yiSID
End Sub
简单 clearcontent