Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Reference A Combobox On The First page.

I have a combobox ( named "ddCity" ) placed on the first page of a
worksheet. On the Activate event of ANY other worksheet, I want to
display a polite message indicating they need to choose a city, first.

How do I reference the combobox?

Something like...

If isnull(Worksheets("Main").ComboBox("ddCity").value ) = True Then
MsgBox "Please Choose A City."
Worksheets("Main").ComboBox("ddCity").Select
Exit Sub
End If

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Reference A Combobox On The First page.

Private Sub Worksheet_Activate()
If Worksheets("Main").ddCity.Value = "" Then
MsgBox "Please Choose A City."
Worksheets("Main").Select
Worksheets("Main").ddCity.Activate
Exit Sub
End If

End Sub


This assumes ddcity is the name of an activeX combobox from the control
toolbox toolbar and the name ddcity is set in the name property when you
right click on it in design mode and select properties.


Tested and worked for me.
--
Regards,
Tom Ogilvy



"Sean" wrote in message
ups.com...
I have a combobox ( named "ddCity" ) placed on the first page of a
worksheet. On the Activate event of ANY other worksheet, I want to
display a polite message indicating they need to choose a city, first.

How do I reference the combobox?

Something like...

If isnull(Worksheets("Main").ComboBox("ddCity").value ) = True Then
MsgBox "Please Choose A City."
Worksheets("Main").ComboBox("ddCity").Select
Exit Sub
End If



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Reference A Combobox On The First page.

Thank you very much! That works perfect!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I turn off page reference in page break preview Nic_Qld Excel Discussion (Misc queries) 2 June 3rd 09 07:17 PM
How To Reference What Is In A ComboBox In A Cell Formulas??? Minitman Excel Worksheet Functions 4 March 25th 08 06:18 PM
How do I copy a combobox to many cells with relative reference? Levc Excel Discussion (Misc queries) 1 November 21st 07 06:58 PM
Add a combobox to an Excel spreadsheet and reference value in VBA Joe Excel Programming 4 September 20th 04 06:49 AM
how to put a reference from a page of a multipage form to another page Valeria[_2_] Excel Programming 2 January 25th 04 08:21 AM


All times are GMT +1. The time now is 03:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"