LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Commandbars - again


I have the following code to read into two drop down lists from an
array. The first reads the first row of the array and selects an item
from it. The second list is populated from the entries in the array
column for the item selected from the first row.

It successfully reads the relevant column into "subcomparray(i)" but
the line
".AddItem subcomparray(i)" does not populate the list in the second
dropdown.

Am I missing something obvious or is it not possible to populate one
dropdown based on the selection made in another without re-creating the
controls?

Thanks for any help

For i = 0 To 20
For j = 0 To 19
allcomparray(i, j) =
Sheets("Data").Cells(Range("Components_array").Row + i, _
Range("Components_array").Column + j).Text
comparray(j) = allcomparray(0, j)
Next j
Next i

If cddtparambarcomp.Text = compseltext Then
ActiveCell = compseltext
GoTo CompSelNoChange
Else: ActiveCell = cddtparambarcomp.Text
End If

compseltext = cddtparambarcomp.Text
compselindex = cddtparambarcomp.ListIndex

CompSelNoChange:
For i = 1 To 20
subcomparray(i) = allcomparray(i, compselindex - 1)
Next i

Set cddtparambarsubcomp = CommandBars("Detailed Table Parameter
Menu").Controls(4)
With cddtparambarsubcomp
For i = 1 To 20
..AddItem subcomparray(i)
Next i
..Visible = True
End With


--
micklloyd
------------------------------------------------------------------------
micklloyd's Profile: http://www.excelforum.com/member.php...o&userid=30696
View this thread: http://www.excelforum.com/showthread...hreadid=505260

 
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
Commandbars PosseJohn Excel Programming 1 December 16th 05 05:51 PM
Commandbars Libby Excel Programming 1 August 8th 04 07:11 PM
CommandBars garry Excel Programming 3 June 24th 04 03:12 PM
CommandBars defj Excel Programming 2 November 16th 03 12:57 AM


All times are GMT +1. The time now is 11:27 PM.

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"