Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting empty rows
I need to delete empty rows but since there are pretty many I want to do a loop. How do I do that? The entire column should be deleted if row 56 equals 0 and the columns are D to DS. Any suggestions? -- edward0380 ------------------------------------------------------------------------ edward0380's Profile: http://www.excelforum.com/member.php...o&userid=29396 View this thread: http://www.excelforum.com/showthread...hreadid=491107 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting empty rows
Hi Edward,
Try: '============ Sub Tester() On Error GoTo 0 Range("D56:DS56").SpecialCells(xlCellTypeBlanks). _ EntireColumn.Delete On Error GoTo 0 End Sub '<<============ --- Regards, Norman "edward0380" wrote in message ... I need to delete empty rows but since there are pretty many I want to do a loop. How do I do that? The entire column should be deleted if row 56 equals 0 and the columns are D to DS. Any suggestions? -- edward0380 ------------------------------------------------------------------------ edward0380's Profile: http://www.excelforum.com/member.php...o&userid=29396 View this thread: http://www.excelforum.com/showthread...hreadid=491107 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting empty rows
Hi Edward,
I should have indicated that I have assumed that you want to delete columns, as in the body of your post, rather than rows, as suggested in the title and opening line. --- Regards, Norman |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting empty rows
Thanks! You are right, I want to delete the columns... But if row 56 i equal to 0 will it not be deleted, how do I solve this -- edward038 ----------------------------------------------------------------------- edward0380's Profile: http://www.excelforum.com/member.php...fo&userid=2939 View this thread: http://www.excelforum.com/showthread.php?threadid=49110 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting empty rows
Hi Edward,
Try: '============ Sub Tester3() Dim rng As Range Dim i As Long Set rng = Range("D56:DS56") For i = rng.Columns.Count To 1 Step -1 With rng(i) If .Value = 0 Then .EntireColumn.Delete End If End With Next i End Sub '<<============ --- Regards, Norman "edward0380" wrote in message ... Thanks! You are right, I want to delete the columns... But if row 56 is equal to 0 will it not be deleted, how do I solve this? -- edward0380 ------------------------------------------------------------------------ edward0380's Profile: http://www.excelforum.com/member.php...o&userid=29396 View this thread: http://www.excelforum.com/showthread...hreadid=491107 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Deleting empty rows | New Users to Excel | |||
deleting empty rows | Excel Discussion (Misc queries) | |||
Deleting All Empty Rows | Excel Discussion (Misc queries) | |||
Deleting non empty rows | Excel Programming | |||
Deleting empty rows | Excel Programming |