View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.newusers
Keith Keith is offline
external usenet poster
 
Posts: 262
Default Delete rows with more or less than 7 columns

Thank you sir, that seems to be it, you have been a great help. I see a very
steep learning curve heading my way!

"Gord Dibben" wrote:

You may also want to qualify which sheet to operate on.

Sub Cleanupdata()
Sheets("Sheet1").Select 'adjust sheetname to suit
rest of code goes here
End Sub


Gord

On Thu, 21 May 2009 12:13:07 -0700, Gord Dibben <gorddibbATshawDOTca wrote:

In your code you ClearContents rather than delete rows so you get blank
rows. Deleted rows automatically shift up.

Try this tested revision...........note the changes made to give you a
dynamic range rather than a hard-coded A2:A42

And I got rid of most of the "selects" which slows code dowm. You rarely
have to select things to work on them.