Thanks for the help, but I'm still confused.
Say my conditions are met and I have created a "message string" in my code.
So when I have the code display the userform, how do I get the string to show
on the userform? If I add a label, can I set the value to the msgVar1? If
so, how? I was trying to set the caption of the label on the userform to the
variable, but didn't have any success. I'm not sure I'm going about this the
right way.
Thanks
"Rick Rothstein" wrote:
> To follow up on Sam's posting.... go into the VB editor and copy/paste
> this...
>
> "Understanding Scope and Visibility"
>
> into the Search Box and then click on the item with the same name in the
> list that appears... this will give you more details about what Sam has
> suggested to you.
>
> --
> Rick (MVP - Excel)
>
>
> "Sam Wilson" <(E-Mail Removed)> wrote in message
> news:A4CB38AC-E2DA-4E13-8A0E-(E-Mail Removed)...
> > Make myVar public - ie don't declare it in a sub, but before the first sub
> > put the line
> >
> > Public myVar as variant
> >
> > Then in your userform code you can refer to it.
> >
> > Sam
> >
> >
> > "PJ" wrote:
> >
> >> I would like to use custom userforms for various dialog boxes, error
> >> trapping, etc. and wanted to know if it is possible to reference a string
> >> variable on a userform. For example, say I have a variable called myVar
> >> in
> >> my code and certain conditions are met where I want to display a
> >> userform. I
> >> want to add a label with text on the userform and have it display the
> >> value
> >> of myVar. Is there a way to do this?
>
> .
>
|