Bom dia, boa tarde ou boa noite. Tudo certo?
Tenho um script no qual exclui uma linha selecionada no excel através de macro. Porém gostaria de excluir várias linhas selecionadas e não somente uma, sem perder a formatação existente. Alguém poderia ajudar? Segue o script:
_______
Sub deletarLinha()
Application.ScreenUpdating = False
Dim sheetPlanilha7 As Worksheet
Dim activerow As Integer
Dim activecol As Integer
activerow = ActiveCell.row
activecol = ActiveCell.Column
If activerow < 23 Then
MsgBox "Não é possivel remover esta linha", , "ATENÇÃO!"
Exit Sub
End If
Rows(activerow).Select
Selection.Delete Shift:=xlUp
Cells(activerow - 1, activecol).Select
ActiveWorkbook.Save
Application.ScreenUpdating = True
End Sub
___________
Obrigado!!