Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Need Help with Deleting Rows

Sub DeleteRows()
Dim lastrow as Long, i as Long
Dim cell as Range
lastrow = cells(rows.count,1).End(xlup)
for i = lastrow to 1 step -1
set cell = cells(i,1)
if cell = 1 then
cell.Resize(7,1).EntireRow.Delete
end if
Next
End Sub

--
Regards,
Tom Ogilvy



" wrote:

I want to delete rows
ie one row that has a certain no in a certain column like 1 in column A

and the next 6 rows that follow

my problem is that this repeats itself many times in the excel sheet
and i am not sure how many times as it varies

so i would like to have a macro which does that


thank you in advance


Regards

Indraneel


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 for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Links and Linking in Excel 1 November 13th 08 08:44 AM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Setting up and Configuration of Excel 1 November 12th 08 06:05 PM
Macro for deleting rows and serialising the remaing rows Srinivasulu Bhattaram Excel Worksheet Functions 1 November 12th 08 01:39 PM
Help!!! I have problem deleting 2500 rows of filtered rows shirley_kee[_2_] Excel Programming 1 January 12th 06 03:15 AM
deleting hidden rows so i can print only the rows showing?????? jenn Excel Worksheet Functions 0 October 6th 05 04:05 PM


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

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"