Thanks
"Per Jessen" wrote in message
...
There is a typo in the statement, use this:
For Each ws In Worksheets
Regards,
Per
"ordnance1" skrev i meddelelsen
...
Thanks, but I get an Object Required error and the following line of text
is highlighted:
For Each ws In Worksheet
"ozgrid.com" wrote in message
...
Sub LoopAllWS()
Dim ws As Worksheet
Dim wsStart As Worksheet
Set wsStart = ActiveSheet
For Each ws In Worksheet
With ws
'No need to use Select use .With code here
End With
Next ws
wsStart.Activate
End Sub
--
Regards
Dave Hawley
www.ozgrid.com
"ordnance1" wrote in message
...
My workbook has over 100 worksheets. I want to be able to execute the
code below, have it cycle through all worksheets and when done leave
the worksheet that was active when the code was started active.
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
With Sheets(n)
.Activate
.Range("A3").Activate
End With
Next n
Application.ScreenUpdating = True