PDA

View Full Version : Solved: populate combobox problem



gibbo1715
07-23-2007, 11:07 AM
Hi All

Can anyone tell me what is wrong with the code below please as it doesnt add anything to my combobox?

thanks

Gibbo

Dim iLastRow As Long

iLastRow = Sheets("Sheet2").Cells(Rows.Count, "A").End(xlUp).Row

ActiveWorkbook.Names.Add Name:="PopulateCombo", RefersToR1C1:=Sheets("Sheet2").Range("A1:A" & iLastRow)

Me.ComboBox1.RowSource = PopulateCombo

malik641
07-23-2007, 11:20 AM
Hey Gibbo,

Try:

Me.ComboBox1.RowSource = Range("PopulateCombo").Address

Good luck!

benny
07-23-2007, 11:26 AM
Hi Gibbo,

Add quotes.

Me.ComboBox1.RowSource = "PopulateCombo"

malik641
07-23-2007, 11:28 AM
Nice one benny :thumb Didn't think of that!

gibbo1715
07-23-2007, 11:32 AM
Thankyou both,

cant believe it was that simple

Gibbo