Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default 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
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
add item to a drop-down list NazRem Excel Discussion (Misc queries) 4 January 4th 09 12:56 PM
ADD ITEM TO A DROP DOWN LIST? William Excel Discussion (Misc queries) 4 September 8th 08 09:05 PM
drop down list/typing item from list error Strike Eagle Loader[_2_] Excel Worksheet Functions 1 May 1st 07 06:35 PM
How do I set up a drop down list to beginning letter of item? kerri Excel Discussion (Misc queries) 1 August 10th 06 06:56 PM
Attaching a 2 item list to a cell / drop-down? Enrique Mahecha Excel Discussion (Misc queries) 8 December 22nd 05 06:30 PM


All times are GMT +1. The time now is 03:46 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"