I am writing a bit of VBA to delete a contiguous range of rows within a table. I found several example on how delete rows and most were with for selected row, or a selection of none contiguous rows. In this question it was set to loop through and delete one row at a time which would work. In another example, they had the following line which did it all in one shot
rows("4:8").delete
Now this seemed ideal to me. I have my start row set as a variable, and I have my last row set as a variable.
DIM First_Row as integer
DIM Last_Row as integer
First_Row = 14
Last_Row = First_Row + Application.worksheetfunction.MAx(Range("B:B")) -1
Rows(First_Row:Last_Row).delete
'That last line is not working
Rows("First_Row:Last_Row").delete
'nor the above
what is the proper syntax to delete a range of rows in one shot without a loop?