LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default visual basic macro code for deleting referenced rows

Try this - checks a1 to a12 deleting rows if the cell is blank.



to find the last row used in a column replace
For r = 12 To 1 Step -1
with
For r = Range("a65536").End(xlUp).Row To 1 Step -1




Sub DelRow()
Dim r As Long
For r = 12 To 1 Step -1
If Cells(r, "a") = "" Then
Rows(r).Delete
End If
Next r
End Su

--
Message posted from http://www.ExcelForum.com

 
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 rows in two columns with a code in visual basic Ruben Excel Discussion (Misc queries) 5 August 27th 08 09:10 AM
Data filter and deleting rows in visual basic Ruben Excel Discussion (Misc queries) 0 August 24th 08 08:38 PM
Selecting Cells With Visual Basic or Macro Code RajenRajput1 Excel Discussion (Misc queries) 5 May 11th 07 05:56 PM
Deleting pictures in Excel using visual basic [email protected] New Users to Excel 3 October 6th 06 07:48 PM
visual basic macro code for deleting referenced rows Frank Kabel Excel Programming 0 January 28th 04 10:05 PM


All times are GMT +1. The time now is 10:33 AM.

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

About Us

"It's about Microsoft Excel"