Referencing a ComboBox control from a Workbook Object?

  • Thread starter Thread starter debartsa
  • Start date Start date
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?
 
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
 
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
 
to all that review....
one of my errors was to use activeworkbook.worksheets....etc. which yields a
compile error

thanks tom
 

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