LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Combo Box if... then... else question

Ryan, I inserted a break to debug the code and it always tells me that
MyComboBox = Empty



"Ryan H" wrote:

Assuming you named your Combobox MyComboBox this should work for you. Put
this code into the ComboBox_Change Event. This will fire each time someone
changes the combobox value. Hope this helps! If so, let me know, click
"YES" below.

Private Sub MyComboBox_Change()

If MyComboBox = €śtest1€ť Then
Range("B1").Formula = "=Sheet2!A1"
Else
Range("B1").Value = ""
MsgBox "B1 has no data source.", vbInformation
End If

End Sub
--
Cheers,
Ryan


"Silvio" wrote:

Hello, I would like to change a cell source base once a selection made from a
combo box. After making a selection from the combo box the code should do
something like:

If MyComboBox = €śtest1€ť then
B1 = Sheet2!A1
Else
B1 has no data source (null)
End if

Whats the easiest way to accomplish my goal in Excel 2007?
PS. B1 is the cell in my fist Sheet.

Thank you,
Silvio

 
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
combo box question Monte0682 Excel Programming 4 April 3rd 07 08:19 PM
Combo Box Question Scott Jacobs Excel Worksheet Functions 0 November 23rd 04 01:40 AM
Combo Box Question WStoreyII Excel Programming 3 July 28th 04 02:29 PM
Combo box question Peter[_28_] Excel Programming 5 February 16th 04 12:09 AM
Combo Box Question [email protected] Excel Programming 2 January 7th 04 03:16 PM


All times are GMT +1. The time now is 07:36 AM.

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

About Us

"It's about Microsoft Excel"