Is it possible to have two Sub Routines with the same name? Example: I am using the following for two different reasons: Private Sub Worksheet_Change(ByVal Target As Range). I am using each for a drop-down list using the case statement
This one opens the three different subroutines based on a drop-down list.
It works based on a drop-down with Easy, Med, Hard as the selection and runs the subroutines.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("Y10")) Is Nothing Then
Select Case Range("Y10")
Case "Easy": RandomEasy
Case "Med": RandomMedium
Case "Hard": RandomHard
End Select
End If
End Sub
This is another one I use for another reason but does not work and it uses a drop-down list.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("Q8")) Is Nothing Then
Select Case Range("Q8")
Case "P1": CopyPuzzle1 'The P1, P2, P3 are in the drop-down represents a puzzle from another tab that is copied/pasted onto the main worksheet
Case "P2": CopyPuzzle2 'The CopyPuzzle1, 2, 3 will copy the puzzle and paste.
Case "P3": CopyPuzzle3
End Select
End If
End Sub
These subroutines work if I use a macro button, but get nothing using a drow-down. Don't even get an error or debug request. Nothing happens
Both are located in the same Module in the worksheet where you click on the sheet's tab and then view code. Both are exactly the same, but why doesn't one work?
Thanks
Jerry
Bookmarks