In the USER FORM code, after the user has clicked "OK," there is a msgbox
ie. MsgBox ("The total price is " & Price & "")
The thing is, I've calculated the Price variable in a MODULE sub.
How can I ensure the price value actually shows up? How do I connect a variable from a module sub to a form?
To be more general, how can I make a message box to show up after that the user clicked "OK". Do I need to have two message boxes within my code?
Code Sample:
In Module:
Dim Price As Currency
Sub Test1()
Price = wsSheet.Range("A1").End(xlDown).Value
End Sub
In Form:
Sub cmdOK_click
MsgBox ("The total price is " & Price & "")
End Sub
Test1aPublic Suband also call it on the condition that user clicksOK. That's an idea and actually it's too late for me to check it. But let us know if that would work for you.Test1()Sub called within the sameSubthat calls the User Form?