[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.excel.programming

Dimmed Keyword as Variable

Zone

12/15/2006 6:21:00 PM

I stupidly dimmed keyword Val as a variant in a userform, type variant,
like this:

Dim HAL, VAL

Now, in every module that Val appears, it as appears as VAL. Yikes! I
found the Dim statement as changed it to

Dim HAL, VVAL

but all the Val statements in other modules still show as VAL.
Obviously, VAL was not dimmed as public, so I don't know why this is
happening! How do I get the VAL in the other modules to return to
their normal capitalization (Val)?

Thanks, James

1 Answer

Zone

12/15/2006 9:38:00 PM

0

Tom, that is absolutely amazing. The Val keyword appeared to continue
operating properly, even while miscapitalized, as you no doubt know.
Very strange. Your breadth of knowledge is awesome. Thank you. James
Tom Ogilvy wrote:
> Try this:
>
> create a variable with the capitalization you want.
> Then delete it.
>
>
> Dim Val
>
>
> then delete it. Now
>
>
> r = Val("123abc")
>
>
> will be capitalized how you expect.
>
>
> When you create a variable (or property, in your case) that is a keyword,
> VBA remembers the capitalization even after you delete the
> variable/property. This just tricks into doing it right.
>
> (adaptation of advice previously posted in the newsgroup).
>
> --
> Regards,
> Tom Ogilvy
>
>
>
>
> "Zone" wrote:
>
> > I stupidly dimmed keyword Val as a variant in a userform, type variant,
> > like this:
> >
> > Dim HAL, VAL
> >
> > Now, in every module that Val appears, it as appears as VAL. Yikes! I
> > found the Dim statement as changed it to
> >
> > Dim HAL, VVAL
> >
> > but all the Val statements in other modules still show as VAL.
> > Obviously, VAL was not dimmed as public, so I don't know why this is
> > happening! How do I get the VAL in the other modules to return to
> > their normal capitalization (Val)?
> >
> > Thanks, James
> >
> >