copperwasher
Board Regular
- Joined
- Mar 1, 2016
- Messages
- 84
- Office Version
- 365
- Platform
- Windows
Hello Top Excel Gurus
I have a workbook containing 36 sheets
Sheets 1 and 2 are summary sheets - that must remain untouched!
sheets 3 to 33 contain pictures (which i have managed to code and add a button to remove them).
The sheets are all differently named too (forex pairs)
But the clearing of data from Rows 1 to 100 is a challenge or the range A1:J100 (Which is the better option)
there are no formulas in the cells, just data which has been pasted in these rows.
My attempt:
Sub ClearContents()
Dim I As Long
For I = 3 To 33
Sheets(CStr(I)).Range("A1:J100").ClearContents
Next I
End Sub
I can see that the sheet reference is not working - i dont know how to specify the worksheets no.3 to no.33
Any help is very much appreciated.
CW
I have a workbook containing 36 sheets
Sheets 1 and 2 are summary sheets - that must remain untouched!
sheets 3 to 33 contain pictures (which i have managed to code and add a button to remove them).
The sheets are all differently named too (forex pairs)
But the clearing of data from Rows 1 to 100 is a challenge or the range A1:J100 (Which is the better option)
there are no formulas in the cells, just data which has been pasted in these rows.
My attempt:
Sub ClearContents()
Dim I As Long
For I = 3 To 33
Sheets(CStr(I)).Range("A1:J100").ClearContents
Next I
End Sub
I can see that the sheet reference is not working - i dont know how to specify the worksheets no.3 to no.33
Any help is very much appreciated.
CW