airforceone
Board Regular
- Joined
- Feb 14, 2022
- Messages
- 201
- Office Version
- 2019
- 2016
- Platform
- Windows
this code is from @Fluff VBA Run macros on multiple sheets, not all sheets
I used code below to retrieve and store my sheetname to array
is there a way to used my stored array sheetname in the code above?
or is there a different way to utilized my code for the "For Loop" code?
My concept code
FROM
TO
VBA Code:
Sub Button1_Click()
Dim ws As Worksheet
'** SET The Sheet Names - MUST Reflect Each Sheet Name Exactly!
WkSheets = Array("ATC1", "BEC1", "DKC1")
For Each ws In Sheets(Array("ATC1", "BEC1", "DKC1"))
ws.Select
Call CheckGoalSeekRev 'Macro1
Next ws
End Sub
VBA Code:
sCount = 1
For Each rngCell In Range("A3:A" & Cells(Rows.Count, "C").End(xlUp).Row)
If rngCell.Value <> "" Then
arrValue(sCount) = rngCell.MergeArea(1).Value
sCount = sCount + 1
End If
Next
is there a way to used my stored array sheetname in the code above?
or is there a different way to utilized my code for the "For Loop" code?
My concept code
FROM
VBA Code:
WkSheets = Array("ATC1", "BEC1", "DKC1")
For Each ws In Sheets(Array("ATC1", "BEC1", "DKC1"))
VBA Code:
wsLoop = arrValue()
For Each ws In Sheets(arrValue())