not so excel-lent
New Member
- Joined
- Jul 3, 2008
- Messages
- 14
I have a workbook that has 22 worksheets that are all formatted the same. Each has a data validation list in H3 and I am trying to set up a macro that will select one of the items in the list (in this case "Prior Week"). I would like to run the macro on all sheets. Below is the code I have entered, but after selecting all sheets it only runs the macro on the first sheet ("CA2"). I'm not very experienced with VBA, and I pieced this code together from various responses to other questions. Any suggestions on how I can get it to run on all sheets?
Sub PWonAllsheets()
'
Sheets(Array("CA2", "CA3", "CA4", "CA5", "CA6", "CA7", "CA8", "CA9", "CA15", "CA18", _
"CA27", "AZ_NV", "FL", "GA", "IL", "MI", "NJ", "NY", "OK", "PA", "TX", "VA")).Select
'
Dim pw As String
pw = "Prior Week"
Range("H3") = pw
End Sub
Thanks in advance for any help!
Larry
Sub PWonAllsheets()
'
Sheets(Array("CA2", "CA3", "CA4", "CA5", "CA6", "CA7", "CA8", "CA9", "CA15", "CA18", _
"CA27", "AZ_NV", "FL", "GA", "IL", "MI", "NJ", "NY", "OK", "PA", "TX", "VA")).Select
'
Dim pw As String
pw = "Prior Week"
Range("H3") = pw
End Sub
Thanks in advance for any help!
Larry