ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete Empty Rows @ End of Template (https://www.excelbanter.com/excel-programming/311934-delete-empty-rows-%40-end-template.html)

Ken[_18_]

Delete Empty Rows @ End of Template
 
Excel 2000 ... I have a Template that consist of 15000
rows. The data I put in this template is always a random
number of rows, but always <15000 records.

I run a recorded Macro that formats the data ... However,
near the end of this recorded code I have VB code
(obtained from a much earlier post) which attempts to
delete all unused rows @ the bottom of the Template.

Issue is ... this last instruction appears to be deleting
all rows below 5319 which often cuts off my data.

Code written as follows:

cLastRow = Cells(Rows.Count, "B").End(xlUp).Row
Set myRng = Range("B" & cLastRow + 1 & ":B15000")
myRng.EntireRow.Delete

Above said ... I am looking for a VB Wizard of this board
to enlighten me on what I need to do or fix here ...
(note: Col B is my 1st Col of data & it includes data on
every row used.)

Thanks ... Kha


All times are GMT +1. The time now is 05:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com