Good afternoon,
I have 6 macros in a module that I call based on the cell value on a particular sheet.
Example:
Named Range value will be a number 1-6
Based on this number, I will call macros 1-6
If I run each macro independently, they all work correctly and they work in another workbook I used it in.
Any help will be appreciated!
See below
Private Sub worksheet_change(ByVal target As Range)
If Range("TOTAL_PAGES") = "2" Then
Call pages2
Else
If Range("TOTAL_PAGES") = "3" Then
Call pages3
Else
If Range("TOTAL_PAGES") = "4" Then
Call pages4
Else
If Range("TOTAL_PAGES") = "5" Then
Call pages5
Else
If Range("TOTAL_PAGES") = "6" Then
Call pages6
Else:
Call pages1
End If
End If
End If
End If
End If
End Sub
I have 6 macros in a module that I call based on the cell value on a particular sheet.
Example:
Named Range value will be a number 1-6
Based on this number, I will call macros 1-6
If I run each macro independently, they all work correctly and they work in another workbook I used it in.
Any help will be appreciated!
See below
Private Sub worksheet_change(ByVal target As Range)
If Range("TOTAL_PAGES") = "2" Then
Call pages2
Else
If Range("TOTAL_PAGES") = "3" Then
Call pages3
Else
If Range("TOTAL_PAGES") = "4" Then
Call pages4
Else
If Range("TOTAL_PAGES") = "5" Then
Call pages5
Else
If Range("TOTAL_PAGES") = "6" Then
Call pages6
Else:
Call pages1
End If
End If
End If
End If
End If
End Sub