Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I cannot delete the extra rows or columns in Excel 2007 | Excel Discussion (Misc queries) | |||
Cannot delete extra rows | Excel Discussion (Misc queries) | |||
How to delete extra rows from bottom? | Excel Discussion (Misc queries) | |||
delete extra columns and rows | Excel Discussion (Misc queries) | |||
Delete extra rows at the end of macro run | Excel Programming |