Hi,
I am trying to perform the same actions on all of the worksheets in my workbook. I have tried the following two codes but neither of them work:
Dim ws As Integer
For ws = 1 To Worksheets.Count
Sheets(ws).Select
Cells(4, 4) = RYear
Range("A5") = "setdefault Period=" & RYear & "00:" & RYear & "13"
Range("A6") = "setdefault Period_from=" & RYear & "00"
Range("A7") = "setdefault Period_to=" & RYear & "13"
Range("B16") = Range("D3") & Range("D4")
Range("B17") = "Report run on " & Format(Date, "mmm dd, yyyy")
Next ws
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
Cells(4, 4) = RYear
Range("A5") = "setdefault Period=" & RYear & "00:" & RYear & "13"
Range("A6") = "setdefault Period_from=" & RYear & "00"
Range("A7") = "setdefault Period_to=" & RYear & "13"
Range("B16") = Range("D3") & Range("D4")
Range("B17") = "Report run on " & Format(Date, "mmm dd, yyyy")
Next
I tried that last one with "next" and "next ws".
Neither of these are making all of the changes that are specified. Any thoughts?
Thank you.
Bookmarks