Duda al introducir formulario que este lo ordene por fecha
Hola,
Hice un userform el cual es un formulario de llenado de boletas o vales, donde tengo:
N° Vale, Fecha, Desde, Hasta, Nombre Persona, Hora, Valor
El cual lo tengo listo, pero quiero que este al presionar el botón me lo valla ordenando por fecha automáticamente, en el caso de que se me olvide introducir algún vale o boleta de una fecha pasada.
Quiero que me lo ordene de más antiguo a más reciente. Les dejo lo que hice:
Private Sub CommandButton2_Click()
Dim fila As Integer
For fila = 5 To 1000
If Hoja1.Cells(fila, 1) = "" Then
Hoja1.Cells(fila, 1) = TextBox1.Text
Hoja1.Cells(fila, 2) = TextBox2.Text
Hoja1.Cells(fila, 3) = TextBox3.Text
Hoja1.Cells(fila, 4) = TextBox4.Text
Hoja1.Cells(fila, 5) = TextBox5.Text
Hoja1.Cells(fila, 6) = TextBox6.Text
Hoja1.Cells(fila, 7) = TextBox7.Text
MsgBox "EL VALE A SIDO INGRESADO"
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
Exit Sub
End If
Next
End Sub
