View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Wilson John Wilson is offline
external usenet poster
 
Posts: 550
Default How to pass values from a userform to a standard module?

-gk-

If you make your variable public at the top of a standard
module, you should be able to retrieve it from anywhere
(including the UserForm)

John

"TBA" wrote in message
...
Excel 2000
Windows 2k Pro

I need to know how I can pass values from a userform to a standard

module-gk-
and vice versa.

I have a Workbook that has a custom menu from which the user can choose a
"Run Setup" option. Choosing this loads and shows a userform. One of the
controls on the userform calls a "Get_Path_and_Filename" subroutine that

is
in a standard module. I'd like to return the path and file name string

from
the standard module to a text box on the userform.

Should I move this subroutine to the userform module? Perhaps it's a

matter
of where I declare variables? Kinda scratching my head on this one, any
suggestions appreciated.

-gk-