Problemas con dos formularios
Buenas tardes, el problema es el siguiente tengo 2 formularios, el primero funciona a la mil maravillas ya que me ubica los datos en a7.. C7, pero el segundo que debería colocar los datos en d7.. F7, los ubica en d8.. F8.. ¿qué puedo hacer?. Gracias.
En el primer formulario
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim fila As Integer
fila = 7
While Cells(fila, 6) <> Empty
fila = fila + 1
Wend
Cells(fila, 1) = TextBox1
Cells(fila, 2) = TextBox2
Cells(fila, 3) = TextBox3
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
TextBox1.SetFocus
Application.ScreenUpdating = True
Application.DisplayAlerts = True
Consumo.Show
End Sub
En el segundo formulario
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim fila1 As Integer
fila1 = 7
While Cells(fila1, 6) <> Empty
fila1 = fila1 + 1
Wend
Cells(fila1, 4) = TextBox1
Cells(fila1, 5) = TextBox2
Cells(fila1, 6) = TextBox3
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
TextBox1.SetFocus
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
En el primer formulario
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim fila As Integer
fila = 7
While Cells(fila, 6) <> Empty
fila = fila + 1
Wend
Cells(fila, 1) = TextBox1
Cells(fila, 2) = TextBox2
Cells(fila, 3) = TextBox3
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
TextBox1.SetFocus
Application.ScreenUpdating = True
Application.DisplayAlerts = True
Consumo.Show
End Sub
En el segundo formulario
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim fila1 As Integer
fila1 = 7
While Cells(fila1, 6) <> Empty
fila1 = fila1 + 1
Wend
Cells(fila1, 4) = TextBox1
Cells(fila1, 5) = TextBox2
Cells(fila1, 6) = TextBox3
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
TextBox1.SetFocus
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
1 Respuesta
Respuesta de Elsa Matilde
1