Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
passing variable
i need to pass a variable (comname$) from worksheet code to an application
in a module. i.e Private Sub Worksheet_Activate() comname$ = "Comboboxone" Application.Run "test.xls'!loadcombo" End Sub in module 1... Sub clearcombo() ActiveSheet.com$.Clear 'where com$ is name of combobox End Sub Help will be appreciated. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
passing variable
And this ClearCombo routine lives in a general module in the same workbook?
If yes, then you don't need to use Application.run. I'd use this behind the worksheet Option Explicit Private Sub Worksheet_Activate() Call ClearCombo(WhichCombo:=Me.ComboBox1) End Sub And this in a General module: Option Explicit Sub ClearCombo(WhichCombo As msforms.ComboBox) WhichCombo.ListFillRange = "" 'just in case WhichCombo.Clear End Sub sunilpatel wrote: i need to pass a variable (comname$) from worksheet code to an application in a module. i.e Private Sub Worksheet_Activate() comname$ = "Comboboxone" Application.Run "test.xls'!loadcombo" End Sub in module 1... Sub clearcombo() ActiveSheet.com$.Clear 'where com$ is name of combobox End Sub Help will be appreciated. Thanks -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Passing a Variable to a Macro | Excel Programming | |||
Passing a variable to a GoTo | Excel Programming | |||
Passing variable to Access | Excel Programming | |||
Passing variable to VarType of other Variable | Excel Programming | |||
Passing variable from one sub to another | Excel Programming |