Caros,
Continuando na linha: "Revisitando As primeiras funções que desenvolvi".
Como deletar as colunas que estão vazias num range informado?
Sub DelEmptyC (DeleteRange As Range)
' Deleta todas as colunas no Range
Dim cCount As Integer, c As Integer
If DeleteRange Is Nothing Then Exit Sub
If DeleteRange.Areas.Count > 1 Then Exit Sub
With DeleteRange
Let cCount = .Columns.Count
For c = cCount To 1 Step -1
If Application.CountA(.Columns(c)) = 0 Then
.Columns(c).EntireColumn.Delete
End If
Next c
End With
End Sub
André Luiz Bernardes
A&A® - Work smart, not hard in any place.
Skype: inanyplace
Nenhum comentário:
Postar um comentário