xcelnovice101
Active Member
- Joined
- Aug 24, 2012
- Messages
- 367
Below is my code for deleting all data in all of the sheets in ThisWorkbook, but I also want to select cell A1 in all sheets in ThisWorkbook. The code does fin until it comes to select cell A1 on the second sheet.
Code:
Sub CLEAR_FS_MTD_REPORT()
Sheets(1).Name = "Sheet1"
Sheets(2).Name = "Sheet2"
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Cells.Delete Shift:=xlUp
Next ws
Dim wss As Worksheet
For Each wss In ThisWorkbook.Worksheets
wss.[A1].Select
Next wss
Sheets(1).Select
End Sub