Caros,
Continuando na linha: "Revisitando As primeiras funções que desenvolvi".
DICA: Todas as funções que criarmos que tenham interação física direta nas planilhas que estivermos utilizando, terão uma performance muito melhor se colocarmos o comando Application.ScreenUpdating = False, antes do início do respectivo processamento.
Como deletar as linhas e colunas num range informado?
Sub DelEveryNthR (DeleteRange As Range, N As Integer)Dim rCount As Long, r As Long
Application.ScreenUpdating = False
If DeleteRange Is Nothing Then Exit SubIf DeleteRange.Areas.Count > 1 Then Exit SubIf N < 2 Then Exit SubWith DeleteRangeLet rCount = .Rows.CountFor r = N To rCount Step N - 1.Rows(r).EntireRow.DeleteNext rEnd WithEnd SubSub DeleteEveryNthC (DeleteRange As Range, N As Integer)Dim cCount As Long, c As Long
Application.ScreenUpdating = FalseIf DeleteRange Is Nothing Then Exit SubIf DeleteRange.Areas.Count > 1 Then Exit SubIf N < 2 Then Exit SubWith DeleteRangeLet cCount = .Columns.CountFor c = N To cCount Step N - 1.Columns(c).EntireColumn.DeleteNext cEnd WithEnd Sub
André Luiz Bernardes
A&A® - Work smart, not hard in any place.
Skype: inanyplace