Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to delete rows


-----Original Message-----
I was hoping to create a VBA function that would identify

empty or blank cells within a range, and then delete the
row associated with that empty or blank cell.

Can anyone provide some help?

Thanks!
.

here a macro:
Sub Macro1()
Dim x As Integer
Dim y As Integer
Dim x1 As Integer

x = "Row Start"
For x1 = "Row Start" To "Row end"
If Len(Cells(x, 5)) = 0 Then '"Column for blank"
exmple a = 1, c = 3
Rows(x).Select
Rows(x).Delete
x = x - 1 'You just delete a line, so need to
back up
End If

x = x + 1
Next x1
End Sub
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 rows Aceensor Excel Discussion (Misc queries) 5 November 14th 08 03:45 PM
Macro to delete rows Hankjam[_2_] Excel Discussion (Misc queries) 4 October 1st 08 03:58 PM
Need a macro to delete rows jmr4h8 Excel Discussion (Misc queries) 9 July 2nd 08 11:16 PM
Macro to delete rows Melanie Breden Excel Programming 2 May 10th 04 11:16 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM


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