Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Combine a combobox with logic

Is there a way to program excel to pull a specifec list based on a cells
value ie. if a1 = 1 pull data for combox from list 1, if a1 = 2 pull data
from list 2 ect, ect
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Combine a combobox with logic

hi
yes
you can use the gotfocus event to set the listfillrange of a sheet combo box
but your list have to be on the sheet somewhere.
example
Private Sub ComboBox1_GotFocus()
If Range("A1").Value = 1 Then
ComboBox1.ListFillRange = "G1:G5"
Else
If Range("A1").Value = 2 Then
ComboBox1.ListFillRange = "H1:H5"
Else
ComboBox1.ListFillRange = "I1:I5"
End If
End If
End Sub
with a form combo box(ON A FORM, NOT THE SHEET), i think it's the row source.
you can also use the additem method. look that up in vb help.

Regards
FSt1


"THILL" wrote:

Is there a way to program excel to pull a specifec list based on a cells
value ie. if a1 = 1 pull data for combox from list 1, if a1 = 2 pull data
from list 2 ect, ect

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Combine a combobox with logic

If your combobox is placed on a worksheet, maybe you could replace them with
cells with Data|Validation.

Then use the instructions at Debra Dalgleish's site:
http://contextures.com/xlDataVal02.html

THILL wrote:

Is there a way to program excel to pull a specifec list based on a cells
value ie. if a1 = 1 pull data for combox from list 1, if a1 = 2 pull data
from list 2 ect, ect


--

Dave Peterson
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
Combine cells with the same reference and combine quantities brandon Excel Discussion (Misc queries) 2 September 17th 08 05:44 PM
fill combobox depending on selection from another combobox Adam Francis Excel Discussion (Misc queries) 2 July 24th 08 07:39 PM
LOGIC H0MELY Excel Discussion (Misc queries) 6 June 4th 08 10:41 PM
If Then logic not enough workerbeeVAB Excel Discussion (Misc queries) 4 January 5th 06 05:24 PM
IF THEN LOGIC flotowntiger Excel Discussion (Misc queries) 5 December 7th 04 12:12 AM


All times are GMT +1. The time now is 01:51 AM.

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"