Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub RemoveEmptyCells_ShiftUp()
Application.ScreenUpdating = False Application.Calculation = xlManual Dim rw As Long, iCol As Long For rw = ActiveSheet.UsedRange.Rows.Count To 1 Step -1 If isempty(cells(rw,1)) Then _ cells(rw,1).Delete Shift:=xlShiftUp Next Application.Calculation = xlAutomatic Application.ScreenUpdating = True End Sub This deletes blank cells in Column A ( second argument of cells is 1) and shifts the cell up. -- Regards, Tom Ogilvy "Todd" wrote in message ... Hi, I am playing with a marcro to delete empty cells. I have a macro that deletes empty rows and I thought I could basically change "rows" to "cells" and it would work. But I guess its not that simple. Can someone tell me what I need to make this work? TIA Todd. Here is the origonal macro. Sub RemoveEmptyRows() Application.ScreenUpdating = False 'xlManual below in Xl95 Application.Calculation = xlCalculationManual Dim rw As Long, iCol As Long For rw = ActiveSheet.UsedRange.Row.Count To 1 Step -1 If Application.CountA(Rows(rw).Entirecell) = 0 Then _ Rows(rw).Delete Next Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True 'xlAutomatic above in xl95 End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
delete row if 2 cells are empty | Excel Discussion (Misc queries) | |||
delete cells column. Delete empty cells | Excel Worksheet Functions | |||
How do I delete rows where cells are empty | Excel Discussion (Misc queries) | |||
Delete Empty Cells in a Macro | Excel Discussion (Misc queries) | |||
Delete Row If Empty Macro | Excel Discussion (Misc queries) |