Views

Histats

Vitrine

VBA Excel - Deletando Colunas vazias no Range - Delete Columns selected in the range


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


Tags: Bernardes, MS, Microsoft, Office, Excel, deletar, apagar, excluir, column, colunas, range















André Luiz Bernardes
A&A® - Work smart, not hard in any place.
Skype: inanyplace 

✔ VBA Brazil®

✔ VBA Brazil®
brazilsalesforceeffectiveness@gmail.com
Related Posts Plugin for WordPress, Blogger...
diHITT - Notícias