Link to home
Start Free TrialLog in
Avatar of cedop
cedop

asked on

passing data from one userform to another

Hi,

I have 2 userforms in an excel macro, in the first one there is a text field and button near it. when the button is pressed, a second userform opens. On the second userform, there is the calander control with an ok button. when a date is selected, and the ok butotn is pressed, I want the second userform to be dismissed, and the date entered into the text field on the first userform with the format dd/mm/yyyy - not including the hours and mins. or whatever goes by default. I also need to reference that date inside the macro in another function within the first userform.
can someone explain how variables are passed along in vba?

thanks in advance
Avatar of EDDYKT
EDDYKT
Flag of Canada image

Just add module and create a public variable there


set the variable when your second form unload

ie

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)


d = "your date form string"
End Sub
Avatar of cedop
cedop

ASKER

where do i put this
ASKER CERTIFIED SOLUTION
Avatar of EDDYKT
EDDYKT
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial