Boa noite,
Veja se, com esta alteração, funciona do jeito que quer:
Sub InserirLinha()
Dim wsAtiva As Worksheet
Dim UltL As Long
Set wsAtiva = ThisWorkbook.ActiveSheet
UltL = Application.WorksheetFunction.Max(10, wsAtiva.Cells(Rows.Count, 2).End(xlUp).Row)
Application.ScreenUpdating = False
Rows(1).Hidden = False
wsAtiva.Range(Cells(1, 1), Cells(1, 7)).Copy: wsAtiva.Cells(UltL + 1, 1).Insert Shift:=xlDown
Rows(1).Hidden = True
Application.ScreenUpdating = True
wsAtiva.Cells(UltL + 1, 2).Value = wsAtiva.Cells(UltL, 2).Value + 1
wsAtiva.Cells(1, 2).Value = wsAtiva.Cells(UltL, 2).Value + 2
Application.CutCopyMode = False
Set wsAtiva = Nothing
End Sub
Abraço
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 20/02/2016 8:19 pm