Un rango de datos para muchos combobox
Hola quisiera saber si existe una manera mas corta de hacer que un mismo rango de datos en hoja excel se utilice para 50 combobox hasta ahora he hecho dos y funciona el código que utilice es :
Private Sub C1a_Enter()
Dim i As Integer
Dim final As Integer
Dim tareas As String
c1a.BackColor = &H80000005
For i = 1 To c1a.ListCount
'Remove an item from the ListBox.
c1a.RemoveItem 0
Next i
For i = 2 To 1000
If Hoja5.Cells(i, 1) = "" Then
final = i - 1
Exit For
End If
Next
'If C1a.ListCount < 1 Then
'CC1a.AddItem "-"
For i = 2 To final
tareas = Hoja5.Cells(i, 1)
c1a.AddItem (tareas)
Next
'End If
End Sub
Private Sub d1a_Enter()
Dim i As Integer
Dim final As Integer
Dim tareas As String
d1a.BackColor = &H80000005
For i = 1 To d1a.ListCount
'Remove an item from the ListBox.
d1a.RemoveItem 0
Next i
For i = 2 To 1000
If Hoja5.Cells(i, 1) = "" Then
final = i - 1
Exit For
End If
Next
'If d1a.ListCount < 1 Then
'd1a.AddItem "-"
For i = 2 To final
tareas = Hoja5.Cells(i, 1)
d1a.AddItem (tareas)
Next
'End If
End Sub
Donde c1a y d1a son combobox , pero me faltan 50 más