Hi
I'm trying to populate a combo box with the headings from a named range. The code runs but no values appear in the list. Would appreciate it if someone could tell me what I'm doing wrong.
I'm trying to populate a combo box with the headings from a named range. The code runs but no values appear in the list. Would appreciate it if someone could tell me what I'm doing wrong.
Code:
Private Sub cmbHeadings_Change()
'================================================================================
'Macro purpose: Populates a combobox with the headers from a named range
'Created by:
'================================================================================
Dim MyRange As Range
Dim i As Integer
Set MyRange = Range("Lists_StoreName_All") '.Offset(-1, 0)
With Me.cmbHeadings
.Clear
For i = 1 To MyRange.Columns.Count
.AddItem MyRange.Cell(1, i).Value
Next i
End With
End Sub