Combo box with dynamic range formula only returns 1 column

hello all, I am a beginner at userform design and trying to get this code to work, in the named range reference on sheet2 I have

=OFFSET(Sheet2!$A$2:Sheet2!$B$2, 0, 0, COUNTA(Sheet2!$A:$A:Sheet2!$B:$B)-1,2) on the user form I have this 

Private Sub UserForm_Initialize()
'Populate combo box.
Dim rngBoProbsOpps As Range
Dim ws As Worksheet
Set ws = Worksheets("Sheet2")
For Each rngBoProbsOpps In ws.Range("BoProbsOpps")
Me.cmbProblemsOpps.AddItem rngBoProbsOpps.Value
Next rngBoProbsOpps
End Sub

Is the problem in the sub? seems like I need something that identifies column1 and column 2.  All the values end up in 1 column.

Thanks for any help

July 3rd, 2013 12:57pm

Replace

For Each rngBoProbsOpps In ws.Range("BoProbsOpps")
Me.cmbProblemsOpps.AddItem rngBoProbsOpps.Value
Next rngBoProbsOpps

with

Me.cmbProblemsOpps.RowSource = "BoProbsOpps"

Free Windows Admin Tool Kit Click here and download it now
July 3rd, 2013 1:08pm

Thank you, you made my day!
July 3rd, 2013 2:12pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics