Formulario con Lista Despegable (va dirigida a Dante Amor)
Hola Dante, agregue una macro para Ordenar la Lista y la modifique de columna y me quedo de esta manera, puede ser?
Sub OrdenoLista()
'
' OrdenoLista Macro
' Macro grabada el 04/10/2014 por VK
'
Sheets("hoja1").Select 'SE TRASLADA A LA HOJA1'
Range("A:A").Sort Key1:=Range("A2"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal 'ORDENA EN FORMA ACENDENTE'
Range("C:C").Sort Key1:=Range("C2"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Sheets("traslados").Select
Range("A12").Select
End Sub
Private Sub CommandButton1_Click()
'Por.Dante Amor
If ComboBox1 = "" Then
MsgBox "Debe introducir un nombre y apellido"
ComboBox1.SetFocus
Exit Sub
End If
If MsgBox("Desea crear el nuevo nombre", vbYesNo) = vbYes Then
u = Hoja1.Range("A" & Rows.Count).End(xlUp).Row + 1
Hoja1.Cells(u, "A") = ComboBox1
cargar
OrdenoLista
MsgBox "Registro creado"
End If
End Sub
Private Sub CommandButton2_Click()
'Por.Dante Amor
If ComboBox2 = "" Then
MsgBox "Debe introducir un origen"
ComboBox2.SetFocus
Exit Sub
End If
If MsgBox("Desea crear el nuevo origen", vbYesNo) = vbYes Then
u = Hoja1.Range("C" & Rows.Count).End(xlUp).Row + 1
Hoja1.Cells(u, "C") = ComboBox2
cargar
OrdenoLista
MsgBox "Registro creado"
End If
End Sub