Passing UserForm Variable To Class Module 
Author Message
 Passing UserForm Variable To Class Module

Hi Everyone -

Can anyone tell me of a way to pass variables from a userform to a class
module.

I have a range that I create through a userform. I need to monitor the range
to see if
users change cells within the range so that they do not leave a formula or a
value upon
finishing modification. I also need this to work in any workbook.

I figured out how to montior the cell changes using application events, but
I can't seem
to figure out how to pass the range from the userform to the class module in
order to
see if the changes were to the range in question.

I tried making the range public, but that didn't seem to work.
I tried creating a public procedure and passing the variables that way.

Either way I an error telling me that either the variable or the
sub/function is not defined.

I know there has to be a way to make this work. But what is it?

Marston



Thu, 21 Mar 2002 03:00:00 GMT  
 Passing UserForm Variable To Class Module
Hi Marston,

As long as you hide the userform, rather than unloading it, you should be
able to access any public variables in it. If you store your range reference
in a Public variable called Range in UserForm1, you should be able to access
it from a standard or class module with:

UserForm1.Range

HTH,

John Green - Excel MVP
Sydney
Australia

Quote:


> Newsgroups: microsoft.public.excel.programming
> Subject: Passing UserForm Variable To Class Module
> Date: Sun, 03 Oct 1999 22:29:50 -0500

> Hi Everyone -

> Can anyone tell me of a way to pass variables from a userform to a class
> module.

> I have a range that I create through a userform. I need to monitor the range
> to see if
> users change cells within the range so that they do not leave a formula or a
> value upon
> finishing modification. I also need this to work in any workbook.

> I figured out how to montior the cell changes using application events, but
> I can't seem
> to figure out how to pass the range from the userform to the class module in
> order to
> see if the changes were to the range in question.

> I tried making the range public, but that didn't seem to work.
> I tried creating a public procedure and passing the variables that way.

> Either way I an error telling me that either the variable or the
> sub/function is not defined.

> I know there has to be a way to make this work. But what is it?

> Marston




Fri, 22 Mar 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Sending String Variables From UserForm To Class Module

2. passing variables between class modules

3. Passing Variables between UserForm/Module

4. Class modules - Hiding module variables

5. Carry value for a string variable from Form Class Module to code in Module

6. Passing a Variable from one Userform to another Userform

7. Accessing Properties of One Class Module From Another Class Module

8. Jumping from procedure in one class module to Function in another class module

9. Class modules 97 - Refering to array within a custom class module

10. Wrapping a userform in a class module


 
Powered by phpBB® Forum Software © phpBB Group