I'm working on automating some excel tasks at work using VBA and having trouble with the following:
I'm trying to create a Sub with multiple Cases which I call with the Case as an argument but it's not working. It always selects the first case. Can anybody point out what I'm doing wrong?
Public Sub Test() Call CaseTest(Case2) End Sub
Public Sub CaseTest(CaseSelect) Select Case CaseSelect Case Case1 MsgBox "Case1" Case Case2 MsgBox "Case2" End Select End Sub