Excel VBA Planilha recopiar linha acima com formatos ao digitar
Este Macro do Aplicativo Microsoft Excel VBA(Visual Basic Application), recopia os formatos existentes na linha anterior para a próxima linha ao digitar a data, para uma nova entrada
Observe que usamos o Evento Change da Folha de Planilha ao digitar, alterar determinada coluna na folha de planilha.
‘//=============’
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Count = 1 And Target.Row > 2 Then
If IsEmpty(Target.Offset(0, 1)) And Not IsEmpty(Target.Offset(-1, 0)) Then
Application.EnableEvents = False
sbx= Target
Target.Offset(-1, 0).EntireRow.Copy Target
On Error Resume Next
Target.EntireRow.SpecialCells(xlCellTypeConstants, 23).ClearContents
Target = sbx
Application.EnableEvents = True
End If
End If
End Sub
![](https://escola.saberexcel.com.br/wp-content/uploads/2013/08/linazul.jpg)
Aprenda tudo sobre planilhas do Aplicativo Microsoft Excel VBA(Visual Basic Application), sozinho, com baixo custo, praticando com os produtos didáticos Escola SaberExcel VBA Estudos® – Treinamentos com Macros, Fórmulas e Funções.
Compre pelo PagSeguro | Compre pelo PayPal | |
![]() |
![]() |
|
Material Didático: Curso Excel VBA Expert |
![]() |
![]() |
![]() |
(*) verifique sua caixa de itens excluídos |
[ |
Excel VBA Planilha recopiar linha acima com formatos ao digitar