View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
scottfoxall scottfoxall is offline
external usenet poster
 
Posts: 40
Default Can I create a list this way?

If i understand correctly?

You have a drop down list that populates based upon cell values

1. place a combobox on the spreadsheet

2. assume that cell C8 is for blue value & C9 for red value

in the VBE under Private Sub Worksheet_SelectionChange(ByVal Target As
Range) paste this code


Dim BlueNo, RedNo
ComboBox1.Clear


BlueNo = Range("C8").Value
RedNo = Range("C9").Value

For i = 1 To BlueNo
ComboBox1.AddItem ("Blue")
Next i


For i = 1 To RedNo
ComboBox1.AddItem ("Red")
Next i


"Maven" wrote:


Is there a way I can use a number in a cell to fill in that number of
cells with a given value? For example, is there a way that I could
enter this kind of information:

Number blue 3
Number red 2

And get this returned to me:

Blue
Blue
Blue
Red
Red

Any suggestions would be appreciated!


--
Maven
------------------------------------------------------------------------
Maven's Profile: http://www.excelforum.com/member.php...o&userid=37826
View this thread: http://www.excelforum.com/showthread...hreadid=573870