Referencing a ComboBox control from a Workbook Object?

D

debartsa

Hi Everybody,

I have a ComboBox control on a Worksheet. From the code behind of the
Worksheet I am able reference it and alter it's properties

i.e. MyComboBox.Text = "Hello"

My goal is to reference that same control from the code behind of the
Workbook instead?

i.e. ThisWorkbook.Worksheets("Sheet1"). ?

Thanks for any help!
Sam

P.S. ThisWorkbook.Worksheets("Sheet1").MyComboBox.Text doesn't work?
 
R

Ricky M. Medley

See the message thread 5 root posts above this one with subject: editing control/form objects on a worksheet
by: Ricky M. Medley....
Is searching for very similair answer. Can watch there also for any responses.

regards
ricky
 
T

Tom Ogilvy

Private Sub Workbook_SheetActivate(ByVal Sh As Object)

If Sh.Name = "Sheet2" Then
ThisWorkbook.Worksheets("Sheet1").MyCombobox.Text _
= Format(Time, "hh:mm:ss.00")
End If
End Sub

worked fine for me as an example of using that notation in th eThisworkbook
event.

--
Regards,
Tom Ogilvy

See the message thread 5 root posts above this one with subject: editing
control/form objects on a worksheet
by: Ricky M. Medley....
Is searching for very similair answer. Can watch there also for any
responses.

regards
ricky
 
R

Ricky M. Medley

to all that review....
one of my errors was to use activeworkbook.worksheets....etc. which yields a
compile error

thanks tom
 
Top