Lista desplegable Variable
Hola! Estoy tratando de hacer una lista desplegable variable de acuerdo a los registros dentro de un rango. ¿Cómo puedo hacer que el rango que tiene la lista como parámetro sea variable?
Este es el código que tengo hasta el momento:
Sub ListaPaisesForm()
Dim n As Integer
n = 9
For i = 1 To 19
If IsEmpty(ThisWorkbook.Sheets("Formulario").Cells(9 + i, 13)) = False Then
n = n + 1
End If
Next i
Dim rng As Excel.Range
Set rng = Range(Cells(13, 3), Cells(13, n))
ThisWorkbook.Sheets("Formulario").Shapes.Range(Array("Drop Down 12")).Select
With Selection
.ListFillRange = rng
.LinkedCell = ""
.DropDownLines = 8
.Display3DShading = False
End With
End Sub
Espero me puedas ayudar y de antemano gracias.
Este es el código que tengo hasta el momento:
Sub ListaPaisesForm()
Dim n As Integer
n = 9
For i = 1 To 19
If IsEmpty(ThisWorkbook.Sheets("Formulario").Cells(9 + i, 13)) = False Then
n = n + 1
End If
Next i
Dim rng As Excel.Range
Set rng = Range(Cells(13, 3), Cells(13, n))
ThisWorkbook.Sheets("Formulario").Shapes.Range(Array("Drop Down 12")).Select
With Selection
.ListFillRange = rng
.LinkedCell = ""
.DropDownLines = 8
.Display3DShading = False
End With
End Sub
Espero me puedas ayudar y de antemano gracias.
Respuesta de calvuch
1