Solved

passing data from one userform to another

Posted on 2004-10-18
3
194 Views
Last Modified: 2008-03-06
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
0
Comment
Question by:cedop
  • 2
3 Comments
 
LVL 26

Expert Comment

by:EDDYKT
Comment Utility
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
0
 

Author Comment

by:cedop
Comment Utility
where do i put this
0
 
LVL 26

Accepted Solution

by:
EDDYKT earned 125 total points
Comment Utility
>>where do i put this

Just insert the module into your excel

0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now