macro to all worksheets

G

Gary''s Student

Sub allsheets()
Dim w As Worksheet
For Each w In Worksheets
w.Range("A1").Value = 1
Next
End Sub
is an example of doing something on all the worksheets in a workbook.
 
D

Don Guillett

Sub allshts()
For Each ws In ActiveWorkbook.Sheets
MsgBox ws.Name
Next ws
End Sub
 
Top