+ Reply to Thread
Results 1 to 7 of 7

Delete entire rows

  1. #1
    Registered User
    Join Date
    04-05-2015
    Location
    Norway
    MS-Off Ver
    Office365
    Posts
    4

    Delete entire rows

    Hi

    In my excel sheet, column A got value from 1100 - 9900. The first one starts at row 5. How do I make an VBA macro to delete rows with value below value 6000?

    Example:

    5: 1100
    6: 1500
    7: 6100
    8: 8000

    In this little example, I want the entire row 5 and 6 to be deleted.
    If anyone could help I would be most thankful!

    Solberto

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    Re: Delete entire rows

    Try this:

    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Delete entire rows


    Hi !

    If thousands line to operate, faster by using an advanced filter : all filtered lines can be deleted at once …

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    Re: Delete entire rows

    Marc L makes an excellent point. However, I offered up a VBA solution as you have requested.

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Delete entire rows


    Advanced filter can be used in a VBA procedure …

    So easy, fast & powerfull !

  6. #6
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Delete entire rows

    Here's another ...

    Assumes data goes out to Column J.. change as needed.

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-05-2015
    Location
    Norway
    MS-Off Ver
    Office365
    Posts
    4

    Re: Delete entire rows

    Thank you Alansidman, Marc L and apo.

    Code worked all well!

    - Solberto

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Delete entire rows ?
    By Lukael in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-29-2014, 04:05 PM
  2. Delete entire rows if the two rows are empty
    By shyampanda in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2011, 11:49 PM
  3. delete entire rows
    By spindoctor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-06-2008, 11:03 PM
  4. Delete Entire Rows
    By razorangel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-19-2006, 11:06 PM
  5. [SOLVED] Macro to select 4 entire rows and then delete rows
    By Scott Viney in forum Excel General
    Replies: 3
    Last Post: 09-22-2005, 03:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1