Caveat: my VBA knowledge is self-taught via Googling so please be patient with me! I have a set of worksheets and am trying to perform the same set of actions through each sheet. Having problem with my codes: E.g. worksheets are "Staging AA 101", "Staging AA 102", "Staging AA 201", "Staging BB 101", "Staging BB 102", "Staging BB 201", "Staging CC 101", "Staging CC 102", "Staging CC 201"
My codes are:
Dim ExpSub(1 To 3) As String
Dim Post(1 To 3) As String
Dim i As Integer 'ExpSub
Dim j As Integer 'Post
ExpSub(1) = "101"
ExpSub(2) = "102"
ExpSub(3) = "201"
Post(1) = "AA"
Post(2) = "BB"
Post(3) = "CC"
For j = 1 To 3 'j for Post
For i = 1 To 3 'i for ExpSub
Sheets("Staging " & Post(j) & " " & ExpSub(i)).Select
Range("AK4").Select
Range(Selection, Selection.Offset(100, 1)).Select
Selection.ClearContents
Next i
Next j
Errored out at this line Sheets("Staging " & Post(j) & " " & ExpSub(i)).Select
How do i loop through all the sheets with such variables please? Thanks in advance!