Pass combo box value to string variable in module

  • Thread starter Thread starter magix
  • Start date Start date
M

magix

Hi,

In the OK button click event, how can I pass back the selected
"me.Combobox1.Value" to my module ?
The combo box is in userform.

Usually in my module, I define a string variable.
e.g
sub Test()
Dim fname as string
...
...
end sub

So how can pass the combox value to variable fname in my Test Module
directly?
Note: I don't want to pass the combox value to cell, and then use fname to
read from cell.

Thanks.

Regards, magix
 
Declare Fname as Public at the top of your module, but inside that General
module.

Option Explicit
Public fname as string
sub test()
....
end sub

is one way.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top