walber luiz
18-01-2019 20:11:23
Boa tarde.
Uso este código para salvar alterações na planilha, mas não funciona para as alterações de data.
Private Sub CmdPlan7_Click()
Lin = Sheets("Plan7").Cells(Cells.Rows.Count, 1).End(xlUp).Row
If Lin < 2 Then Lin = 2
Application.ScreenUpdating = False
Sheets("Plan7").Activate
For i = 2 To Lin
If Range("A" & i).Value = CDate(TxtData.Text) Then
Cells(i, 1).Value = CDate(TxtData.Text)
Cells(i, 2).Value = Format(TxtValor.Text, "R$ 0.00#,##")
Cells(i, 3).Value = TxtDescrição.Text
Cells(i, 4).Value = TxtObservação.Text
Exit For
End If
Next
TxtData.Text = ""
TxtValor.Text = ""
TxtDescrição.Text = ""
TxtObservação.Text = ""
Application.ScreenUpdating = True
Call BtnPlan7_Click
End Sub
Uso este código para salvar alterações na planilha, mas não funciona para as alterações de data.
Private Sub CmdPlan7_Click()
Lin = Sheets("Plan7").Cells(Cells.Rows.Count, 1).End(xlUp).Row
If Lin < 2 Then Lin = 2
Application.ScreenUpdating = False
Sheets("Plan7").Activate
For i = 2 To Lin
If Range("A" & i).Value = CDate(TxtData.Text) Then
Cells(i, 1).Value = CDate(TxtData.Text)
Cells(i, 2).Value = Format(TxtValor.Text, "R$ 0.00#,##")
Cells(i, 3).Value = TxtDescrição.Text
Cells(i, 4).Value = TxtObservação.Text
Exit For
End If
Next
TxtData.Text = ""
TxtValor.Text = ""
TxtDescrição.Text = ""
TxtObservação.Text = ""
Application.ScreenUpdating = True
Call BtnPlan7_Click
End Sub