Passing variables or arrays to userform objects 
Author Message
 Passing variables or arrays to userform objects

Hi I have had a great deal of difficulty trying to pass arrays or
variables to a userform
when i  load or call it. In the documentation for user forms it says
they are objects and can as such be passed values. when i try this it
accepts the variables. It flags an error when run though. it makesw
sense that there should be a way to receive the data within the form
like you would when writing a function or sub but their is no reference
or example of this in the help files. Any ideas, send me an example or
help reference. Thanks Much Rob B.


Wed, 18 Jun 1902 08:00:00 GMT  
 Passing variables or arrays to userform objects
In addition to the information provided by Bill Manville,

sStr = "This is Textbox1"
sStr1 = "Sheet1!A1:A10"
Userform1.Textbox1.Text = sStr
Userform1.Listbox1.Rowsource = sStr1
Userform1:show

Is one way you can pass information into a userform before you show it.

Then, if you hide the userform rather than unload it, you can get the values
held by all the controls (or change their values in anticipation of
reshowing the userform).

Regards,
Tom Ogilvy


Quote:
> Hi I have had a great deal of difficulty trying to pass arrays or
> variables to a userform
> when i  load or call it. In the documentation for user forms it says
> they are objects and can as such be passed values. when i try this it
> accepts the variables. It flags an error when run though. it makesw
> sense that there should be a way to receive the data within the form
> like you would when writing a function or sub but their is no reference
> or example of this in the help files. Any ideas, send me an example or
> help reference. Thanks Much Rob B.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Passing variables or arrays to userforms

2. Passing a Variable from one Userform to another Userform

3. Passing arrays to and from userforms

4. Pass variable to userform

5. Passing a variable through a UserForm

6. Array variables on a UserForm

7. Passing variables between userforms and/or normal procedures

8. Excel 97: Pass variable from userform to Sub ?

9. Passing UserForm Variable To Class Module

10. Passing Variables between UserForm/Module


 
Powered by phpBB® Forum Software © phpBB Group