I have several ComboBoxes on a Sheet called ComboBox1, ComboBox2, ComboBox3, etc. I want to populate each ComboBox Value Property using an array of Data. e.g. ComboBox & i = Array(1,i), where i is the counter in a For Next Loop.
I cannot work out how to increment each ComboBox Name to get the result I want. Please help.
Here is my code:
Private Sub DisplayRecords()
Dim row As Long, i As Integer
row = wsControls.Range("D3").Value
' Populate Database Array with selected Function
Dim details As Variant
details = db.Range("A" & row + 1 & ":" & "CK" & row + 1)
' Populate Input Form with Selected Function
With wsControls
For i = 1 To 20
.ComboBox & i.Value = details(1, i) ' THIS IS WHERE THE PROBLEM IS!!!
Next i
End With
End Sub