E
EeOr
Hi I would like to loop through every sheet in a wrokbook and delete row 1
from it, I currently have the following code:
Dim sht As Worksheet
For Each sht In Sheets
Rows(1).Delete
X = X + 1
Next sht
MsgBox "Workbook contains " & X " Sheets", vbOKOnly
When this code is run it is deleting row 1 from the same sheet based on the
number of sheets I have so for example if I have 13 sheets it will delete 13
rows from sheet 13 instead of row 1 from all sheets. Can someone please
show me where I am going wrong?
Thanks
jon
from it, I currently have the following code:
Dim sht As Worksheet
For Each sht In Sheets
Rows(1).Delete
X = X + 1
Next sht
MsgBox "Workbook contains " & X " Sheets", vbOKOnly
When this code is run it is deleting row 1 from the same sheet based on the
number of sheets I have so for example if I have 13 sheets it will delete 13
rows from sheet 13 instead of row 1 from all sheets. Can someone please
show me where I am going wrong?
Thanks
jon