Question : set workseet as active then run a macro on other worksheets

I have a workbook with multiple worksheets but there are 3 of these that I want to run a specific macro over.
The 3 worksheets are
sheet9
sheet11
sheet12
I've already set the focus on one of the above sheet
What I want to try and do is with the below query if sheet 9 is the active sheet then the below query runs the macro over sheet11 then sheet12. Or if sheet11 is the active sheet then the macro runs over sheet9 then sheet 12, then the same for sheet12 if it is the active sheet tnen sheet9 and sheet11 has the macro assigned

Is this possible
Code Snippet:
1:
2:
3:
4:
5:
6:
Set sht = ActiveSheet


If MsgBox("Did you want to set Fatigue focus?", vbYesNo) = vbYes Then
 Call Value_Fatigue_Formula
End If

Answer : set workseet as active then run a macro on other worksheets

one method below

Cheers
Dave
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
Sub Carl()
    Dim shtNames, sht
    Dim wsname As String
    wsname = ActiveSheet.Name
    shtNames = Array("Sheet9", "Sheet11", "Sheet12")
    For Each sht In shtNames
        If sht <> wsname Then
            Sheets(sht).Activate
            Call value_Fatigue_Formula
        End If
    Next sht
End Sub
Random Solutions  
 
programming4us programming4us