Tengo un Problema con fórmula, tengo un ComboBox1 que al elegir debe cargarme información en los textbox
Tengo un ComboBox precargado con información y al elegir un código me debería cargar en el textbox1 información de la hoja1, textbox2 información de la hoja6 pero no las carga, aquí el código, gracias.
Private Sub ComboBox1_Click()
Dim i As Integer
Dim j As Integer
Dim final As Integer
Dim FINAL2 As Integer
For i = 2 To 1000
If Hoja1.Cells(i, 1) = "" Then
final = i - 1
Exit For
End If
Next
For i = 2 To 1000
If Hoja5.Cells(i, 1) = "" Then
FINAL2 = i - 1
Exit For
End If
Next
For i = 2 To final
If ComboBox1 = Hoja1.Cells(i, 1) Then
TextBox1 = Hoja1.Cells(i, 2)
Exit For
End If
Next
For j = 1 To FINAL2
If ComboBox1 = Hoja6.Cells(j, 1) Then
TextBox2 = Hoja6.Cells(j, 3)
Exit For
End If
Next
End Sub
Private Sub ComboBox1_Enter()
Dim i As Integer
Dim j As Integer
Dim H As Integer
Dim final As Integer
Dim tareas As String
ComboBox1.BackColor = &H80000005
For i = 1 To ComboBox1.ListCount
ComboBox1.RemoveItem 0
Next i
For j = 2 To 1000
If Hoja1.Cells(j, 1) = "" Then
final = j - 1
Exit For
End If
Next
For H = 2 To final
tareas = Hoja1.Cells(H, 1)
ComboBox1.AddItem (tareas)
Next
'End If
End Sub
Private Sub CommandButton1_Click()
Dim validar As Boolean
Dim validarfecha As Boolean
If TextBox1 = "" Then
UserForm4.Show
Exit Sub
End If
If TextBox3 = "" Then
UserForm5.Show
Exit Sub
End If
If TextBox4 = "" Then
UserForm6.Show
Exit Sub
End If
If TextBox5 = "" Then
UserForm7.Show
Exit Sub
End If
validar = IsNumeric(TextBox3.Value)
If validar = False Then
UserForm8.Show
TextBox3.BackColor = &HFF00&
Exit Sub
End If
validarfecha = IsDate(TextBox5.Value)
If validarfecha = False Then
UserForm9.Show