Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Delete rows if column looks blank

I need a macro to delete the entire row if the cell in that row in column A:A
looks blank. I need it to check every row. I say "looks" because the cells
will be part of a list, however I would still like them to be deleted if they
have a formula if they look as though nothing is in them... Please help...
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Delete rows if column looks blank

Sub killum()
n = Cells(Rows.Count, 1).End(xlUp).Row
For i = n To 1 Step -1
If Cells(i, 1).Value = "" Then
Cells(i, 1).EntireRow.Delete
End If
Next
End Sub

--
Gary''s Student - gsnu200834


" wrote:

I need a macro to delete the entire row if the cell in that row in column A:A
looks blank. I need it to check every row. I say "looks" because the cells
will be part of a list, however I would still like them to be deleted if they
have a formula if they look as though nothing is in them... Please help...

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Delete rows if column looks blank

This makes it check them inifinitely so the macro never stops. Why does this
happen? Is there a way to fit it?

"Gary''s Student" wrote:

Sub killum()
n = Cells(Rows.Count, 1).End(xlUp).Row
For i = n To 1 Step -1
If Cells(i, 1).Value = "" Then
Cells(i, 1).EntireRow.Delete
End If
Next
End Sub

--
Gary''s Student - gsnu200834


" wrote:

I need a macro to delete the entire row if the cell in that row in column A:A
looks blank. I need it to check every row. I say "looks" because the cells
will be part of a list, however I would still like them to be deleted if they
have a formula if they look as though nothing is in them... Please help...

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Delete rows if column looks blank

Probably by modifying to look something like this:

Sub killum()
n = Cells(Rows.Count, 1).End(xlUp).Row
While (n = 1)
If Cells(n, 1).Value = "" Then
Cells(n, 1).EntireRow.Delete
n = n - 1
End If
Wend
End Sub

HTH,

Eric

" wrote:

This makes it check them inifinitely so the macro never stops. Why does this
happen? Is there a way to fit it?

"Gary''s Student" wrote:

Sub killum()
n = Cells(Rows.Count, 1).End(xlUp).Row
For i = n To 1 Step -1
If Cells(i, 1).Value = "" Then
Cells(i, 1).EntireRow.Delete
End If
Next
End Sub

--
Gary''s Student - gsnu200834


" wrote:

I need a macro to delete the entire row if the cell in that row in column A:A
looks blank. I need it to check every row. I say "looks" because the cells
will be part of a list, however I would still like them to be deleted if they
have a formula if they look as though nothing is in them... Please help...

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Delete rows if column looks blank

Actually, Gary's code should work just fine (upon actually looking at it!).
It should not create an infinite loop situation. Please check to ensure you
got the "Step -1" part in your code - if you have "Step 1" or nothing at all,
the loop will go on forever.


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
delete the non blank rows depending on Column Harn88 Excel Programming 1 November 18th 08 08:37 AM
Delete Blank Rows - specify column via dialog porter444 Excel Programming 1 November 30th 07 04:45 PM
Delete Rows if any cell in Column H is blank but do not Delete Fir manfareed Excel Programming 4 September 28th 07 05:20 PM
Delete entire rows where there is a blank in column A Chris Hankin[_2_] Excel Programming 7 June 11th 06 09:56 AM
To Delete the specific rows when blank is found on column A ddiicc Excel Programming 3 August 5th 05 05:32 AM


All times are GMT +1. The time now is 07:19 PM.

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"