I'd like to use event code to set two variables in order to pass them to a sub (module) for further processing. I can use event code for one variable - no problem. Is it possible to perform the same trick for two variables ?
Something like this code:
Code
Dim Dt_Req As Date
Dim LocVar As String
Application.EnableEvents = False
'First step: select location
If Not Intersect(Target, Range("F9")) Is Nothing Then
Range("A" & Sheets("VBA Data").Range("O35")).Select '<---- takes user where he needs to be
LocVar = "AFR"
End If
MsgBox LocVar & "," & Dt_Req '<- - - Box shows LocVar and 00:00:00 - makes sense
'Second step: user sets requested date by picking it
For j = 0 To 27 '28 day planning horizon
If Not Intersect(Target, Range("N" & 103 + j)) Is Nothing Then
Dt_Req = Target.Value
'Call Loc_Summary(LocVar, Dt_Req)
MsgBox LocVar & " , " & Dt_Req '<- - - - - - -now, the box shows ", 02/05/2022" What made LocVar disappear ?? Retriggering the event ?
End If ' ^-------------------------^
Next
Application.EnableEvents = False
Display More
Thank you.