Delete columns


Posted by Adrae on December 13, 2001 1:17 PM

How can I write a macro to delete columns that are both empty and hidden? Thanks :-) Adrae



Posted by bob Umlas on December 13, 2001 1:33 PM

for i=256 to 1 step -1
if columns(i).hidden then
if application.worksheetfunction.counta(columns(i))=0 then
columns(i).Delete
End If
End If
Next