HOW CAN I DELETE A COLUMN BASED ON A CONDITION
I want to delete an entire column if it is EMPTY
Please help |
HOW CAN I DELETE A COLUMN BASED ON A CONDITION
Sub DeleteEmptyColumns()
lastcol = ActiveSheet.Cells(ActiveCell.Row, _ Columns.Count).End(xlToLeft).Column Application.ScreenUpdating = False For r = lastcol To 1 Step -1 If Application.CountA(Columns(r)) = 0 Then Columns(r).Delete End If Next r Application.ScreenUpdating = True End Sub Gord Dibben MS Excel MVP On Tue, 16 Dec 2008 15:43:01 -0800, ya wrote: I want to delete an entire column if it is EMPTY Please help |
All times are GMT +1. The time now is 02:40 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com