LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default How to Delete Rows in Excel In a Do Loop

hello
i need some help with deleting Rows in excel using a do loop

my program looks like this
Sub Cleanup()
Dim r1 As Range
Dim r2 As Range

Set r1 = Cells(6, 2)
Set r2 = ActiveSheet.Rows("46:52")

Do While r1.Value < ""
r2.Select
'Selection.Delete Shift:=xlUp

r2.Font.Bold = True
Set r1 = r1.Offset(47, 0)
Set r2 = r2.Offset(47, 0)

Loop

End Sub


The problem i am having is when i make the things i want to delete bold
they do become bold but when i want to delete those rows it does for
the first row and then stops and says "OBJECT REQUIRED" i known i make
making a mistake in the code somewhere but not getting where


thank you in advance for your help/advice


Regards
Indraneel

 
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
how do i find and delete all empty rows in an excel worksheet AinSF Excel Worksheet Functions 3 September 1st 06 01:38 AM
Excel Novice: Delete blank rows Kezia Excel Discussion (Misc queries) 2 August 25th 06 04:56 PM
I WANT TO DELETE A WIDE OF DATE IN A EXCEL FILE Wing Excel Discussion (Misc queries) 1 November 25th 05 02:38 AM
How do I delete columns and rows in Excel, not just hide them Eddie Excel Discussion (Misc queries) 2 November 23rd 05 05:11 PM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM


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