Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Drop Down box displays only first list item
I had a problem with Dropdown boxes which Dave Peterson and Kevin Beckham
helped me with (thanks, guys!), but now another problem has arisen. I have a drop down (Forms tolbar) in Column A which sets the fill range of a dropdown in Column C, the code for this is shown below. But the displayed text in the ColumnC drop down is always "(none)" which happens to be the first item in each of the possible fill ranges. I can select a value in this drop down, and the proper value is entered in the linked cell, but the text displayed in the drop down box is always "(none)". Can anyne tell me what is going wrong? (The code for the listfillrange transfer is shown in full below in case it is the culprit) Darren --------The Full Code------- Sub ChangeDropDownC() 'From Dave Peterson and Kevin Beckham Dim ColB_DD As DropDown Dim ColA_DD As DropDown Dim strCaller As String Dim strFillRange As String Dim intLink As Integer 'will return the name of the responsible drop-down strCaller = Application.Caller() With ActiveSheet.Shapes(strCaller) intLink = .ControlFormat.Value End With Set ColA_DD = ActiveSheet.DropDowns(strCaller) strCaller = Replace(strCaller, "A", "C") Set ColB_DD = ActiveSheet.DropDowns(strCaller) ColB_DD.ListIndex = 0 'empty it intLink = Application.WorksheetFunction.Index _ (Range("List_OutfitTypes"), intLink) If intLink -1 Then ColB_DD.ListFillRange = Worksheets("GarmentsByType").Range("GarmentByType" ). _ Offset(0, intLink).Resize(8, 1).Address(external:=True) Else ColB_DD.ListFillRange = Worksheets("GarmentsByType").Range("GarmentByType" ). _ Resize(1, 1).Address(external:=True) End If ColB_DD.ListIndex = 1 End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Drop Down box displays only first list item
Oops - figured it out. Rather silly error on my part. :)
-- Darren "Throughout the 20th Century, small groups of men seized control of great nations, built armies and arsenals, and set out to dominate the weak and intimidate the world." An unintentionally ironic George W. Bush State of the Union address 28th January 2003 "Darren Hill" wrote in message ... I had a problem with Dropdown boxes which Dave Peterson and Kevin Beckham helped me with (thanks, guys!), but now another problem has arisen. I have a drop down (Forms tolbar) in Column A which sets the fill range of a dropdown in Column C, the code for this is shown below. But the displayed text in the ColumnC drop down is always "(none)" which happens to be the first item in each of the possible fill ranges. I can select a value in this drop down, and the proper value is entered in the linked cell, but the text displayed in the drop down box is always "(none)". Can anyne tell me what is going wrong? (The code for the listfillrange transfer is shown in full below in case it is the culprit) Darren --------The Full Code------- Sub ChangeDropDownC() 'From Dave Peterson and Kevin Beckham Dim ColB_DD As DropDown Dim ColA_DD As DropDown Dim strCaller As String Dim strFillRange As String Dim intLink As Integer 'will return the name of the responsible drop-down strCaller = Application.Caller() With ActiveSheet.Shapes(strCaller) intLink = .ControlFormat.Value End With Set ColA_DD = ActiveSheet.DropDowns(strCaller) strCaller = Replace(strCaller, "A", "C") Set ColB_DD = ActiveSheet.DropDowns(strCaller) ColB_DD.ListIndex = 0 'empty it intLink = Application.WorksheetFunction.Index _ (Range("List_OutfitTypes"), intLink) If intLink -1 Then ColB_DD.ListFillRange = Worksheets("GarmentsByType").Range("GarmentByType" ). _ Offset(0, intLink).Resize(8, 1).Address(external:=True) Else ColB_DD.ListFillRange = Worksheets("GarmentsByType").Range("GarmentByType" ). _ Resize(1, 1).Address(external:=True) End If ColB_DD.ListIndex = 1 End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
add item to a drop-down list | Excel Discussion (Misc queries) | |||
ADD ITEM TO A DROP DOWN LIST? | Excel Discussion (Misc queries) | |||
drop down list/typing item from list error | Excel Worksheet Functions | |||
How do I set up a drop down list to beginning letter of item? | Excel Discussion (Misc queries) | |||
Attaching a 2 item list to a cell / drop-down? | Excel Discussion (Misc queries) |