Thursday, 12 April 2018

worksheet function - Deleting specific rows/columns from excel


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.



Answer



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


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...