Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete extra rows at the end of macro run

Hello! Hope all is well!

I created a macro that manipulates some data and it works great
however, one part of the macro takes a value and copies it down th
entire column because it doesn't change.

Unfortunately, the amount of data in the spreadsheet (rows) is dynamic
So when I run the macro on two different sets of data, I sometime
have too much copied down the column so it looks like this:

xxx xxx xxx xxx 0019 xxx xxx xxx
xxx xxx xxx xxx 0019 xxx xxx xxx
xxx xxx xxx xxx 0019 xxx xxx xxx
xxx xxx xxx xxx 0019 xxx xxx xxx
001

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete extra rows at the end of macro run

If you have a column that always has an entry in the last row of tha
you want to keep and is empty in all the rows you want to remove the
you can use



Dim lRow As Long
lRow = Range("a65536").End(xlUp).Row + 1
Rows(lRow & ":65536").Delete ' or clearcontents



You can also use a similar code to find out how far to copy your dat
down so that you do not end up with the extra data that needs to b
delete

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete extra rows at the end of macro run

That worked perfectly, thank you VERY much for your help. I reall
appreciate it

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

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
I cannot delete the extra rows or columns in Excel 2007 ChemDistribution Excel Discussion (Misc queries) 3 May 17th 23 11:42 AM
Cannot delete extra rows jmj713 Excel Discussion (Misc queries) 6 January 8th 09 09:23 PM
How to delete extra rows from bottom? Lentenrose Excel Discussion (Misc queries) 1 November 10th 06 05:23 PM
delete extra columns and rows matt charlton Excel Discussion (Misc queries) 1 June 7th 05 08:46 PM
Delete extra rows at the end of macro run jmatchus Excel Programming 0 January 21st 04 08:50 PM


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

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

About Us

"It's about Microsoft Excel"