PDA

View Full Version : [SOLVED:] Passing arguments/variables to Forms



DavidS
09-23-2005, 03:16 AM
Hi,

I am new to Excel VBA - please excuse what may be obvious.

I have a working Excel VBA macro and would like to use a form to gather data. I then need to be able to assign the data to variables so the macro runs correctly (I'm assuming this is the correct process). I have the form and the code behind the text/combo boxes etc. I just don't know how to call the form so that the data collected is passed to the variables in the main macro. I'd appreciate any info, links etc. I think the gap in my understanding is how I declare variables and call the form but can't find any examples of how to do this. Can the form also be used to display the information that is generated by the macro?

Thanks
David

Bob Phillips
09-23-2005, 03:29 AM
You have a response in the public newsgroups.

Airborne
09-23-2005, 10:32 AM
Hi David,

Welcome to VBAX. I'm not sure if I understand what you mean...I'm still a VBA student http://vbaexpress.com/forum/images/smilies/045.gif but I've a added simple file which shows you how to call a form.
If this is not what you are looking for just upload your file (ZIP it) so people on the forum can have a go at it.
Regards,

Rob.

DavidS
09-28-2005, 01:53 AM
Hi Rob

Many thanks for your form and code. This is exactly what I was looking for.

Regards
David

Airborne
09-28-2005, 03:59 AM
Hi David,

Glad I could be of help. Don't forget to mark your thread solved. Go to the top of this post, click Thread Tools, choose Mark Thread Solved and click Perform Action:) .

Regards,

Rob.