Guardar en dos hojas continuas...
Hola con el siguiente código he logrado guardar los datos en la hoja seleccionada por el checkbox pero como hago para que los guarde en ods hojas diferentes?
Private Sub CommandButton1_Click()
Dim i As Integer
Dim final As Integer
Dim j As Integer
Dim actual As Double
For i = 1 To 10000
If Hoja2.Cells(i, 1) = "" Then
final = i
Exit For
End If
Next
If CheckBox1.Value = True Then
Worksheets("Yopal").Cells(final, 1) = ComboBox1
Worksheets("Yopal").Cells(final, 2) = TextBox1.Value
Worksheets("Yopal").Cells(final, 3) = TextBox2.Value
Worksheets("Yopal").Cells(final, 4) = TextBox3.Value
Worksheets("Yopal").Cells(final, 5) = TextBox4.Value
Worksheets("Yopal").Cells(final, 6) = TextBox5.Value
Worksheets("Yopal").Cells(final, 7) = DTPicker1.Value
UserForm2.ComboBox1 = ""
UserForm2.TextBox1 = ""
UserForm2.TextBox2 = ""
UserForm2.TextBox3 = ""
UserForm2.TextBox4 = ""
UserForm2.TextBox5 = ""
UserForm2.TextBox6 = ""
Else
For i = 1 To 10000
If Hoja3.Cells(i, 1) = "" Then
final = i
Exit For
End If
Next
If CheckBox2.Value = True Then
Worksheets("CASIMENA").Cells(final, 1) = ComboBox1
Worksheets("CASIMENA").Cells(final, 2) = TextBox1.Value
Worksheets("CASIMENA").Cells(final, 3) = TextBox2.Value
Worksheets("CASIMENA").Cells(final, 4) = TextBox3.Value
Worksheets("CASIMENA").Cells(final, 5) = TextBox4.Value
Worksheets("CASIMENA").Cells(final, 6) = TextBox5.Value
Worksheets("CASIMENA").Cells(final, 7) = DTPicker1.Value
UserForm2.ComboBox1 = ""
UserForm2.TextBox1 = ""
UserForm2.TextBox2 = ""
UserForm2.TextBox3 = ""
UserForm2.TextBox4 = ""
UserForm2.TextBox5 = ""
UserForm2.TextBox6 = ""
End If
End If
UserForm2.Hide
End Sub
Por favor ayudenme....
Slds!
Crysthian