Hi
I've been asked to write code which deletes everything from row 9 downwards in a table.
The table goes from row 7 (which has the titles) and row 8 has some formulas which should be retained.
I'd written this code, which selects a cell in the table, then highlights the region.
Range("D7").CurrentRegion.select
However, I want to offset the region by two rows, so wrote this:
Range("D7").CurrentRegion.Offset(-2,0).Select
However, it won't let me offset the current region by 2 rows (from row 7 to row 9).
Does anyone know how to do this?
I'd then want to delete the new range.
Thanks in advance.
I've been asked to write code which deletes everything from row 9 downwards in a table.
The table goes from row 7 (which has the titles) and row 8 has some formulas which should be retained.
I'd written this code, which selects a cell in the table, then highlights the region.
Range("D7").CurrentRegion.select
However, I want to offset the region by two rows, so wrote this:
Range("D7").CurrentRegion.Offset(-2,0).Select
However, it won't let me offset the current region by 2 rows (from row 7 to row 9).
Does anyone know how to do this?
I'd then want to delete the new range.
Thanks in advance.