Lets say you get a report with 30 rows of data, you delete the last two and then go to cell A1. If you hit Ctrl+Shft+End the cells are all highlight including the blank cells that were deleted. I know that you can delete the blank rows, save/exit the workbook and then reopen it to correct this problem. What I'm wondering is there an easy snippet of code that can be used to select the data but ignore the deleted areas.
In other words, and perhaps more clearly stated, If I have data in cells A1:B30 and use Ctrl+Shft+End cells A1:B30 are selected. If I then delete the data in A29:B30, return my cursor to A1, and hit Ctrl+Shft+End, the data selection is still A1:B30. Is there an easy way with code to make it select A1:B28? This is just a sample, the original report could have any number of rows and or columns and some times I get a report that already has blank rows at the end. I want to be able to select data only, no blank rows that may be lingering.
If it helps, I often use the Ctrl+Shft+End in conjunction with something like this to format my data:
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1").CurrentRegion, , xlYes).Name = "Table1"
I'm attaching a simple test file that had data in A1:B30, and I've already deleted A29:B30. With the A1 selected you should see that Ctrl+Shft+End highlight all the way down to B30. Even Ctrl+End will take you to B30.
As always, thanks in advance for any assistance.
Whh3
Bookmarks