StevenChin
New Member
- Joined
- Sep 3, 2024
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
Hi,
Hope you can help.
I receive a similar report from different person. In the last row of column A, some reports have Grand Summaries and some reports don't. I have 2 macros that I use depending if there is a grand summaries which is a bit annoying because i always have to check first.
I have been searching for a VBA code but could find a suitable one. I really hope someones can help to create a VBA that can to go to last row and if Grand Summaries exist, I need to run below commends which is select the entire row of the grand summaries and down to the last row of the sheet and delete everything. This is what i run daily.
Range("A1").Select
Selection.End(xlDown).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
If the last row doesn't have Grand Summaries on the report then move 1 row down and select the entire row and down to the last row of the sheet and delete everything which is what I am using below.
Range("A1").End(xlDown).Offset(1, 0).Select
ActiveCell.EntireRow.Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearFormats
Selection.Delete Shift:=xlUp
Thanks in advance.
Hope you can help.
I receive a similar report from different person. In the last row of column A, some reports have Grand Summaries and some reports don't. I have 2 macros that I use depending if there is a grand summaries which is a bit annoying because i always have to check first.
I have been searching for a VBA code but could find a suitable one. I really hope someones can help to create a VBA that can to go to last row and if Grand Summaries exist, I need to run below commends which is select the entire row of the grand summaries and down to the last row of the sheet and delete everything. This is what i run daily.
Range("A1").Select
Selection.End(xlDown).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
If the last row doesn't have Grand Summaries on the report then move 1 row down and select the entire row and down to the last row of the sheet and delete everything which is what I am using below.
Range("A1").End(xlDown).Offset(1, 0).Select
ActiveCell.EntireRow.Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearFormats
Selection.Delete Shift:=xlUp
Thanks in advance.