Thread: Use a variabel
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Use a variabel

Alvin,

It depends when you want to use it. If you want to use it whilst the form is
still in memory, you can declare it as a public property in the form.
outside of procedures, and access it as a property of the form class.
Something like

'--- in the form

myFormVar = "testing"
myModule
'...

'--- in themodule
Public Sub myModule()

Msgbox Userform1.myFormVar

End Sub

If the form won't be in memory, you need to declare it as a public variable
in a module and just access it directly, without any qualifictaion. This is
clearly the more flexible.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Alvin Hansen" wrote in message
...
Hi!!

A variabel named in a form (general)
how and can I use this variabel in a macro (module)

Best regards alvin