Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to delete all columns within the used range that contain no data
all the way down. My code below works fine for doing rows, but I can't find syntax to do the same on columns. Any help? Sub DeleteEmptyRows() Dim LastRow As Long Dim r As Long LastRow = ActiveSheet.UsedRange.Row - 1 + ActiveSheet.UsedRange.Rows.Count Application.ScreenUpdating = False For r = LastRow To 1 Step -1 If Application.WorksheetFunction.CountA(Rows(r)) = 0 _ Then Rows(r).Delete Next r End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleting empty rows | New Users to Excel | |||
Deleting empty cells | Excel Worksheet Functions | |||
Deleting all empty raws and columns. | Excel Discussion (Misc queries) | |||
Deleting All Empty Rows | Excel Discussion (Misc queries) | |||
Deleting empty rows | Excel Programming |