M
Matthew Dyer
i'm using the following code to clear/delete anything and everything in already existing sheets:
Sub wbclear()
Dim N As Long
Dim ttl As Long
ttl = ThisWorkbook.Worksheets.Count
For N = 1 To ttl
Worksheets(N).Cells.Delete
Next N
End Sub
what i'd also want is to have cell a1 selected but adding range("a1").select does not work, and i think it's simply because i'm never activating the sheets via code, just deleting the data held in the sheets. is there a bit of code i could use to select cells without activating the sheet?
Sub wbclear()
Dim N As Long
Dim ttl As Long
ttl = ThisWorkbook.Worksheets.Count
For N = 1 To ttl
Worksheets(N).Cells.Delete
Next N
End Sub
what i'd also want is to have cell a1 selected but adding range("a1").select does not work, and i think it's simply because i'm never activating the sheets via code, just deleting the data held in the sheets. is there a bit of code i could use to select cells without activating the sheet?