I have a macro that uses "If Then" to choose what macro to run based on the ActiveCell. I would like to use the Select Case method instead, but need help to do it. How would I change this code?
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Sheets("MacroTest").Select
'MacroTest.Unprotect Password:="yanks"
If Not Intersect(Target, Range("RecAccess")) Is Nothing Then
Call RecAccess
Else
If Not Intersect(Target, Range("EFS")) Is Nothing Then
Call EFS
Else
If Not Intersect(Target, Range("Consents")) Is Nothing Then
Call Consents
Else
If Not Intersect(Target, Range("Privacy")) Is Nothing Then
Call Privacy
Else
If Not Intersect(Target, Range("Guardian")) Is Nothing Then
Call Guardian
Else
MsgBox "Cell not in named ranges"
End If
End If
End If
End If
End If
Application.ScreenUpdating = True
Application.DisplayAlerts = True
'Sheet1.Protect Password:="yanks"
End Sub