Return to site

Delete a macro in excel 2011 for mac using vba

broken image
broken image
broken image

The above code uses the same logic, where it specifies the row numbers and Excel will delete these rows one by one. You can also delete multiple rows by specifying these rows in the code.įor example, the below code will delete row number 1, 5 and 9 in the worksheet: Sub DeleteEntireRow() The above code first specifies the row that needs to be deleted (which is done by specifying the number in bracket) and then uses the EntireRow.Delete method to delete it. To delete an entire row in Excel using VBA, you need to use the EntireRow.Delete method.įor example, if you want to delete the entire first row in a worksheet, you can use the below code: Sub DeleteEntireRow() Delete Alternate rows (or Delete Every Third/Fourth/Nth Row).