+ Reply to Thread
Results 1 to 6 of 6

VBA to Delete a given number of rows.

  1. #1
    Registered User
    Join Date
    05-08-2016
    Location
    Uniontown, PA
    MS-Off Ver
    2007
    Posts
    7

    VBA to Delete a given number of rows.

    I have been trying to solve this for way to long by myself.
    I'm attempting to create a vba macro to delete 94 rows in line.
    I want to select a manually selected cell, then run a macro to delete the next 94 rows down.
    Then select one row down and run the macro again.
    I'm importing large amount of data and need to eliminate 94 rows at a time.
    PLEASE, any and all suggestions would be appreciated by this 82 year old man.
    Thank you in advance!
    Jerome

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,901

    Re: VBA to Delete a given number of rows.

    Something like (untested):

    Please Login or Register  to view this content.
    Selection is the active/selected cell. Offset(1) is the next row down. Resize does what it says. EntireRow, what it says. Delete.

    Test on a copy of your workbook. I would always advise making several copies before starting to (try to) delete stuff.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,053

    Re: VBA to Delete a given number of rows.

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not told us about this. You are required to do so. Cross-posts are allowed but you must provide a link to your posts on other sites.

    Please see Forum Rule #7 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important: https://excelguru.ca/a-message-to-forum-cross-posters/

    (Note: this requirement is not optional. No help to be offered until you provide a link or, for members with fewer than 10 posts, a comment telling us where else you have posted this query.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,901

    Re: VBA to Delete a given number of rows.

    Tested now.

    Please Login or Register  to view this content.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,901

    Re: VBA to Delete a given number of rows.

    You have a solution here, and several answers on the other forum.



    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon (Next to Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,901

    Re: VBA to Delete a given number of rows.

    You have acknowledged the solution I offered here on the other forum.



    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon (Next to Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. Macro to delete rows relatively rather than by row number
    By wmjenner in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-14-2018, 03:59 AM
  2. [SOLVED] Delete all rows where in col AH contains a number .
    By I need excel help in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-04-2018, 01:13 AM
  3. [SOLVED] Delete every nth rows which is dependent on total number of rows
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-24-2013, 02:14 AM
  4. Delete rows that do not contain numeric number
    By MaddyG in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-07-2013, 06:14 PM
  5. [SOLVED] VBA insert/delete rows to accommodate exact number of rows from incoming data
    By iloc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-12-2012, 06:19 PM
  6. Delete rows containing a number
    By hesham63 in forum Excel General
    Replies: 5
    Last Post: 08-01-2011, 08:29 PM
  7. Delete x number of rows
    By bosco2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-25-2011, 03:32 PM

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