ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Referencing a ComboBox control from a Workbook Object? (https://www.excelbanter.com/excel-programming/284891-referencing-combobox-control-workbook-object.html)

debartsa

Referencing a ComboBox control from a Workbook Object?
 
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?



Ricky M. Medley

Referencing a ComboBox control from a Workbook Object?
 
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


"debartsa" wrote in message ...
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?



Tom Ogilvy

Referencing a ComboBox control from a Workbook Object?
 
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

"Ricky M. Medley" wrote in message
...
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

"debartsa" wrote in message
...
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?





Ricky M. Medley

Referencing a ComboBox control from a Workbook Object?
 
to all that review....
one of my errors was to use activeworkbook.worksheets....etc. which yields a
compile error

thanks tom


"Tom Ogilvy" wrote in message
...
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

"Ricky M. Medley" wrote in message
...
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

"debartsa" wrote in message
...
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?








All times are GMT +1. The time now is 02:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com