PDA

View Full Version : How to poulate listbox with data from the row?



Alexon2008
01-15-2008, 02:28 PM
On sheet1 i have embedded combobox and listbox. I want to populate listbox with data from the row. If case "omega" then populate listbox with values from cells b3, c3,d3 and as far there is values in row 3.

I have this code which populate listbox but with data from the columns.
glemte lige noget, brug denne

Private Sub ComboBox1_Click()
Select Case ComboBox1.Value
Case "Omega"
ListBox1.ListFillRange = "Ark1!B3:B" & Cells(65500, "B").End(xlUp).Row
Case "Alfa"
ListBox1.ListFillRange = "Ark1!P3:P" & Cells(65500, "p").End(xlUp).Row
Case "Delta"
ListBox1.ListFillRange = "Ark1!S3:S" & Cells(65500, "s").End(xlUp).Row
Case "Gamma"
ListBox1.ListFillRange = "Ark1!o3:o" & Cells(65500, "o").End(xlUp).Row
Case "Zeta"
ListBox1.ListFillRange = "Ark1!r3:r" & Cells(65500, "r").End(xlUp).Row
End Select
End Sub

Bob Phillips
01-15-2008, 04:34 PM
Case "Omega"
ListBox1.ListFillRange = "Ark1!B3:B" & ARk1!Cells(3,ARk1!.Columns.Count).End(xlToLeft).Column