Ctrl-end key is supposed to bring me to the bottom, right-most cell. However, on several cases, it goes beyond that, meaning it goes hundreds of cells down, even if there are actually no data on those cells.
Can you advise a VBA script on how to clean-up those possibly invisible data that causes this? I'm pretty sure it doesn't work with a regular delete as despite doing that, it still behaves the same way.
Ctrl-End does take you to the bottom-right cell, it just uses different rules to what you'd expect in deciding what that cell should be. Just about any cell that's been referenced in any way will be included in the decision. It's annoying, but that's how Excel "works".
Here's a description of how to address the problem.
To paraphrase:
To delete any unused rows:
delete entire row
To delete any unused columns:
Save the file. Note: In older versions of Excel, you may have to Save, then close and re-open the file before the used range is reset.
This script will reset the last used row for any sheet that is active when it is run.
Sub Reset()
Dim lngCount As Long
lngCount = ActiveSheet.UsedRange.Rows.Count
End Sub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With