View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Pass Variable Question

It seems to me that you are already doing what is needed. The things to be
aware of is

- don't unload the form, just hide it, or the variables disappear
- if fltDate is declared as a form variable, make it Public, and qualify the
variable with the form name when using in another module
- if flDate is declared in a standard module, declare it as Public and it
can be used anywhere, without qualification

--

HTH

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


"SyrHoop" wrote in message
...
I have a simple form that I load, it asks for a date. It has a submit
button. I want to be able to use that date after the submit button is
clicked. How do I go about doing that in VBA?

Sub Macro()
UserForm.Show
fltDate = UserForm.txtDate.Value
end sub

Private CommandButton_click()

msgbox (fltDate) *** The msgbox is blank ***

end sub

Thanks in advance