Hi Excel Experts,
I'm currently trying to create a macro to format some data.
The data we receive are usually quite consistent except for some "ghost" rows at the end of the worksheet.
The only way I found to get rid of those is the follow...
Unfortunately... the only way that I've found to make excel receive and accept the input that those "ghost" row have been deleted is to save the file, otherwise even if deleted if I run the same macro again those "ghost rows" will still be there.
Is there any way to make Excel realize that those "ghost" rows have been deleted without saving the file?
Thanks for your support and enjoy your weekend.
I'm currently trying to create a macro to format some data.
The data we receive are usually quite consistent except for some "ghost" rows at the end of the worksheet.
The only way I found to get rid of those is the follow...
Code:
Dim LR1 As Integer 'last cell used in worksheet
LR1 = Range("A1").SpecialCells(xlLastCell).Row
Dim LR2 As Integer 'last cell in region
LR2 = Range("A1").CurrentRegion.Rows.Count
If LR1 > LR2 Then
Rows(LR1 & ":" & LR2 + 1).delete
Unfortunately... the only way that I've found to make excel receive and accept the input that those "ghost" row have been deleted is to save the file, otherwise even if deleted if I run the same macro again those "ghost rows" will still be there.
Is there any way to make Excel realize that those "ghost" rows have been deleted without saving the file?
Thanks for your support and enjoy your weekend.
Last edited: