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

Preguntas similare

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


Respuesta Responder a este mensaje
#2 Fabian
18/01/2005 - 03:25 | Informe spam
Gracias, lo estoy probando, seguramente te voy a volver a consultar. Gracias

"KL" escribió en el mensaje
news:OihdGlM$
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
>
>


email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida