Hi guys,
Just experimenting using a combo box to display a list of values from a tab but keep running into a problem. I've attached the file. Please go to the code window and test run the userform1.
Dim rng As Range
Dim ws As Worksheet
Dim lastrowAP As Integer
Set ws = Worksheets("List of medications")
lastrowAP = Worksheets("List of medications").Range("A:A").SpecialCells(xlCellTypeLastCell).Row
For Each rng In ws.Range("A2:" & lastrowAP)
Me.combobox1.AddItem rng.Value
Next rng
When I run it, it says Method range of object failed error...
Can anybody help me with this? I think the logic makes sense, which is set variables, find the last row in col A, then make a loop that starts from top to lastrow??
Thanks
Bookmarks