Hello,
Can someone help me how to pass variables between two userforms, for example pass the value of a date (Calendar userform) to another userform (label).
Any help will be very grateful.
Regards
Hello,
Can someone help me how to pass variables between two userforms, for example pass the value of a date (Calendar userform) to another userform (label).
Any help will be very grateful.
Regards
Hello Francisco Sousa,
You can data via Global variables in a VBA module or directly between the UserForms. To pass a value directly between forms, both forms must be loaded into memory by using either the Show method of the UserForm or by calling the VBA Load function.
Most Calendars copy the date to the active cell of the worksheet. What is the name of the control on the Calendar that displays the date?
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Star below the post.3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
Hello,
Thanks for your help, I attached an Excel file if you want to help me. How do I pass the day (variable our more others variables) from the Userfom Calendar to add in a label in another Userform.
Best Regards
FS
Try this.
Please Login or Register to view this content.
Click the * Add Reputation button in the lower left hand corner of this post to say thanks.
Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.
Hello Skywriter
I made the same test like your suggestion previously, but when I call the userform FolhaCaixa1 the variable "data" declared as Public in userform Calendario goes empty. Remember that I have two useforms (Calendario and Folhacaixa1) and my problem is that I can't see the value of "data" variable in the userform Folhacaixa1
For instance, in portuguese the word "data" means date.
Best regards
FS
So the way this works is I click the button Call Calendar on the sheet Value. The calendar pops up, I click on a date and the other form pops up with the date I chose in the big label at the top. Try it.
Hi skywriter
I tried your file at post # 6 and I got this error
"Couldn't load an object because it is not available on this machine"
Is there specific reference to be used ?
Another point
In toolbox I tried right click >> Additional Control , nothing appeared as before
Is there anything wrong with my office?
< ----- Please click the little star * next to add reputation if my post helps you
Visit Forum : From Here
Last edited by skywriter; 05-10-2015 at 10:51 AM.
Hello,
It works, and I come to thank you all again for your invaluable help and your readiness.
But I found other way that works, the code below shows how it was done;
This is the code on the Calendario userform:
Please Login or Register to view this content.
And this is the code on FolhaCaixa1 userform, when the value is passed on UserForm_Initialize()
And it's work.Please Login or Register to view this content.
Thank you once again.
Regards,
FS
You can remove this line:
since you aren't actually using that variable at all.Please Login or Register to view this content.
Remember what the dormouse said
Feed your head
Thanks for the advice. I removed it, and works.
A Guru is always an Guru.
Regards
FS
Thanks for sharing the tag code, I will remember that.
If your original request is fulfilled please click the Thread Tools drop down box above your first post and choose solved.
If you are happy with my help, please consider clicking the add reputation button in the lower left hand corner of this post.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks