Código funcionando em partes
Enviado: 13 Jan 2019 às 20:14
Boa noite.
Estou usando este código para realizar alterações na planilha usando textbox, mas quando tento alterar a data não funciona.
Quanto o restante consigo alterar normalmente.
segue o código que uso
Private Sub CmdPlan1_Click()
Lin = Sheets("PLAN1").Cells(Cells.Rows.Count, 1).End(xlUp).Row
If Lin < 2 Then Lin = 2
Application.ScreenUpdating = False
Sheets("PLAN1").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
End Sub
Estou usando este código para realizar alterações na planilha usando textbox, mas quando tento alterar a data não funciona.
Quanto o restante consigo alterar normalmente.
segue o código que uso
Private Sub CmdPlan1_Click()
Lin = Sheets("PLAN1").Cells(Cells.Rows.Count, 1).End(xlUp).Row
If Lin < 2 Then Lin = 2
Application.ScreenUpdating = False
Sheets("PLAN1").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
End Sub