InputBox al que se le incluye un ComboBox
He leído en muchas webs que la funcion InputBox permite unicamente la entrada de texto simple, lo que sugieren es crear un formulario en el que poner el combobox y eso he hecho, mi problema viene al volcar el contenido del combobox en una celda específica.
Pongo el código por si me podéis sugerir algo
Private Sub aprobado_click()
Dim estado, prioridad As String
estado = ComboBox1.Value
prioridad = ComboBox2.Value
Set h = Sheets("SELECCIÓN")
Set r = h.Columns("W")
Set b = r.Find(estado, lookat:=xlWhole)
If ComboBox1 = "" Or ComboBox2 = "" Then
alerta = MsgBox("Debes seleccionar los criterios de búsqueda", vbalert, "RRHH")
If alerta = vbOK Then Exit Sub
End If
If Not b Is Nothing Then
ncell = b.Address
Do
If h.Cells(b.Row, "Q") = prioridad Then
alerta = MsgBox("Vas a proceder a APROBAR la solicitud " & h.Cells(b.Row, "A").Value, vbalert, "RRHH")
If alerta = vbOK Then
h.Cells(b.Row, "W").Value = "APROBADO"
h.Cells(b.Row, "X").Value = Now
h.Cells(b.Row, "Y").Formula = Year(h.Cells(b.Row, "X").Value)
h.Cells(b.Row, "Z").Formula = MonthName(Month(h.Cells(b.Row, "X").Value), False)
h.Cells(b.Row, "AA").Formula = Day(h.Cells(b.Row, "X").Value)
frmpersonalseleccion.Show
aprobado.Visible = False
denegado.Visible = True
pausado.Visible = True
buscar.Visible = False
End If
Exit Do
End If
Set b = r.FindNext(b)
Loop While Not b Is Nothing And b.Address <> ncell
End If
End Sub
Quiero que el valor del combobox1 del frmpersonalseleccion se ponga en la h.Cells(b.Row, "AB") de este proceso.
Pongo la programacion que tengo en el frmpersonalseleccion
Private Sub CommandButton1_Click()
'aquí debería ir un código
Unload Me
End Sub
Private Sub UserForm_Initialize()
Application.ScreenUpdating = False
ComboBox1.Clear
Sheets("ESCALAS").Select
Range("E1").Select
Do While ActiveCell.Value <> ""
ComboBox1.AddItem ActiveCell
ActiveCell.Offset(1, 0).Select
Loop
End Sub