I have a table with the values for the combobox in row 2, columns 11-76. I picked up the following code to fill the combobox. Of course it fills based on the data being all in a column.
Private Sub UserForm_Initialize()
'define variable types
Dim rng As Range
Dim I As Long
Application.ScreenUpdating = False
'Active sheet where office list is
Sheets("OfficeLocations").Activate
'enter loop
For I = 2 To 67
'data is in column "B"
Set rng = ActiveSheet.Range("B" & I)
InputForm.ComboBox1.AddItem rng.Value
Next I
Sheets("MainMenu").Select
Range("G11").Select
End Sub
I'd really appreciate a suggestion / example / nudge on how to get the data for combobox from a row.
As always, thanks in advance for the suggestions.
G-Man
Private Sub UserForm_Initialize()
'define variable types
Dim rng As Range
Dim I As Long
Application.ScreenUpdating = False
'Active sheet where office list is
Sheets("OfficeLocations").Activate
'enter loop
For I = 2 To 67
'data is in column "B"
Set rng = ActiveSheet.Range("B" & I)
InputForm.ComboBox1.AddItem rng.Value
Next I
Sheets("MainMenu").Select
Range("G11").Select
End Sub
I'd really appreciate a suggestion / example / nudge on how to get the data for combobox from a row.
As always, thanks in advance for the suggestions.
G-Man