Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting empty rows Felix New Users to Excel 1 February 3rd 09 07:48 AM
deleting empty rows EngelseBoer Excel Discussion (Misc queries) 3 September 7th 08 01:09 AM
Deleting All Empty Rows bodhisatvaofboogie Excel Discussion (Misc queries) 3 May 18th 06 12:36 PM
Deleting non empty rows Jan Kronsell Excel Programming 3 October 22nd 05 11:18 PM
Deleting empty rows Foss Excel Programming 4 June 4th 04 07:41 AM


All times are GMT +1. The time now is 11:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"