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

You can't increment a string by a value of 1. Seperate the Cell letter &
number. This seemed to work in my test on excel 2003.

Sub delete()
Sheets("output").Select
Count = 1
MaxCount = 10
While Count < MaxCount
cell = "a" & Count
Range(cell).Select
If Selection = "LYR" Then
Selection.EntireRow.delete
Else
End If
Count = Count + 1
Wend
End Sub

" wrote:

I have a macro setup to copy data based off of filtres from one work
sheet to another. Only problem being is when it copies the data over it
copies the title row over each time so i have multiple sets of titles.
This is the macro i have so far which is totaly incorrect but it shows
what i'm trying to do. Any help would be greatly appreciated. "LYR" is
text and is one of the titles.


Sub delete()
'' Section to remove redundent titles put in when copying data from
original sheet
Sheets("output").Select
Min = "a3"
Max = "a65500"
cell = Min
While cell Max
Range(cell).Select
If Selection = "LYR" Then
Selection.EntireRow.delete:=xlUp
Else
End If
cell = cell + 1
Wend
End Sub


Thanks
Andrew


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
How to Delete Rows in Excel In a Do Loop indraneel Excel Worksheet Functions 6 September 15th 06 09:51 AM
Loop all sheetsand delete empty rows Sige Excel Programming 2 July 27th 05 12:22 PM
Delete rows in multiple sheets without loop? MTT727 Excel Programming 2 July 26th 05 03:07 PM
loop to delete rows... Froglegz Excel Programming 5 August 1st 04 09:56 PM
How do I delete rows and columns in With With End Loop? Bob Benjamin Excel Programming 3 November 16th 03 12:26 AM


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