additem en combobox

17/01/2005 - 19:14 por Fabian | Informe spam
Alguien me puede decir como se hace para llenar un combobox. Pegue un
combobox en hoja1. Gracias.

Sub Prueba()
Dim R as Range
For Each R In Worksheets("Hoja1").Range("A:A")
Valor = R.value
ComboBox1.AddItem (Valor)
If R = "" Then Exit For
Next
End Sub
 

Leer las respuestas

#1 KL
17/01/2005 - 20:18 | Informe spam
Fabian,

Prueba este codigo.

Saludos,
KL

Sub Prueba()
Dim celda As Range, uFila As Long, fila As Long
With Worksheets("Hoja1")
uFila = .Cells(.Rows.Count, 1).End(xlUp).Row
ComboBox1.Clear
For fila = 1 To uFila
If .Cells(fila, 1) <> "" Then ComboBox1.AddItem (.Cells(fila,
1))
Next fila
End With
End Sub


"Fabian" wrote in message
news:OBqdmBM$
Alguien me puede decir como se hace para llenar un combobox. Pegue un
combobox en hoja1. Gracias.

Sub Prueba()
Dim R as Range
For Each R In Worksheets("Hoja1").Range("A:A")
Valor = R.value
ComboBox1.AddItem (Valor)
If R = "" Then Exit For
Next
End Sub


Preguntas similares