3

I want to delete specific rows from Microsoft excel. My data set has around 900,000 rows, I want to get ride of rows/columns that are for example, from b325890-b500000 without dragging my mouse down and clearing it. How would I do this? I am using Excel 2011 on A Mac.

2 Answers 2

1

How do I delete a range of rows using VBA?

Excel VBA Examples for Deleting multiple Rows at time

The following example will delete Row 5 to 10 at a time from the active worksheet.

'In this Example I am deleting Rows 5 to 10
Sub sbDeleteARowMulti()

Rows("5:10").Delete

End Sub

Instructions

  1. Open an Excel Workbook
  2. Press Alt+F11 to open VBA Editor
  3. Insert a Module from Insert Menu
  4. Copy the above code and Paste in the code window
  5. Save the file as macro enabled workbook
  6. Press F5 to execute it

Source Delete Rows and Columns in Excel VBA

1

You may also like to try the Go To function. Very simple: on your mac, press CTRL+G (control, not command) and the Go To dialog will open.

Do you want to delete the entire rows between 325890-500000? If so enter 325890:500000 and click OK. Excel will select the rows, and you can right-click on any of the row numbers on the left, and delete, or clear contents.

Or do you want to delete only within column B across those rows? If so enter b325890:b500000 and click OK. Excel selects those cells and you can delete (and shift cells) or clear contents.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .