
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