Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default macro to delete rows if cell blank in column

Hi, i need a macro to delete empty rows if a cell in A3:A200 is blank.
Ex:
A B C
3 FILL FILL FILL
4 FILL FILL
5 FILL FILL FILL
6
7 FILL FILL FILL
In this example, i need to delete row 4 and 6.
Can this be done?
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,533
Default macro to delete rows if cell blank in column

Hi

Try this:

Sub DeleteRows()
FirstRow = 3
LastRow = 200

For r = LastRow To FirstRow Step -1
If Range("A" & r).Value = "" Then
Rows(r).EntireRow.Delete
End If
Next
End Sub

Regards,
Per

"puiuluipui" skrev i meddelelsen
...
Hi, i need a macro to delete empty rows if a cell in A3:A200 is blank.
Ex:
A B C
3 FILL FILL FILL
4 FILL FILL
5 FILL FILL FILL
6
7 FILL FILL FILL
In this example, i need to delete row 4 and 6.
Can this be done?
Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default macro to delete rows if cell blank in column

Sub rowkiller()
Set r = Range("A3:A200")
Set rr = r.SpecialCells(xlCellTypeBlanks)
rr.EntireRow.Delete
End Sub

--
Gary''s Student - gsnu200907
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default macro to delete rows if cell blank in column

It's working.
Thanks!

"Per Jessen" wrote:

Hi

Try this:

Sub DeleteRows()
FirstRow = 3
LastRow = 200

For r = LastRow To FirstRow Step -1
If Range("A" & r).Value = "" Then
Rows(r).EntireRow.Delete
End If
Next
End Sub

Regards,
Per

"puiuluipui" skrev i meddelelsen
...
Hi, i need a macro to delete empty rows if a cell in A3:A200 is blank.
Ex:
A B C
3 FILL FILL FILL
4 FILL FILL
5 FILL FILL FILL
6
7 FILL FILL FILL
In this example, i need to delete row 4 and 6.
Can this be done?
Thanks!



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default macro to delete rows if cell blank in column

It's working.
Thanks!

"Gary''s Student" wrote:

Sub rowkiller()
Set r = Range("A3:A200")
Set rr = r.SpecialCells(xlCellTypeBlanks)
rr.EntireRow.Delete
End Sub

--
Gary''s Student - gsnu200907

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
Macro to delete blank rows and move data/info samoan Excel Discussion (Misc queries) 3 September 19th 08 04:50 PM
Macro to delete blank rows in a data range Youlan Excel Discussion (Misc queries) 5 September 17th 08 08:51 AM
Delete multiple rows where a blank cell is located kippers Excel Discussion (Misc queries) 2 April 11th 08 11:18 AM
To delete rows when more than one cell is blank [email protected] Excel Worksheet Functions 4 September 27th 06 10:49 PM
Delete blank rows Macro Richard Excel Discussion (Misc queries) 3 November 4th 05 09:02 AM


All times are GMT +1. The time now is 06:59 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"