+ Reply to Thread
Results 1 to 4 of 4

Macro to delete rows relatively rather than by row number

  1. #1
    Registered User
    Join Date
    01-22-2004
    Location
    Visalia, CA / USA
    MS-Off Ver
    2016
    Posts
    72

    Wink Macro to delete rows relatively rather than by row number

    I'm a novice to VBA and macros but I'm trying to create a simple macro to eliminate blank or text rows from hundreds of rows of data provided by my local utility company. In the attached sample file, say I have the cursor positioned at A5. What I want the macro to do is go down the column (END + DOWN), and then delete the three rows that follow (Rows 29-31), then keep going to the next spot (END + DOWN) and delete the three rows after that (56, 57, 58) etc. But I don't want to specify specific row numbers because I want to use this "generically" such that those three rows are deleted regardless of their row number.

    I'm sure this is simple enough if you know what you're doing. But I don't.

    Thanks
    Attached Files Attached Files
    Bill in CA

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,029

    Re: Macro to delete rows relatively rather than by row number

    How about
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro to delete rows relatively rather than by row number

    See next code
    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Macro to delete rows relatively rather than by row number

    Another way...
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

+ 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] Macro Find set criterias to a colomn of number, delete the rows that don't meet criterias
    By TAMMY32 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-03-2017, 04:09 PM
  2. [SOLVED] Help to modify Macro - delete rows that DO NOT contain a negative number.
    By chicalaeti in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-11-2013, 05:51 PM
  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. [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
  5. [SOLVED] Macro to delete rows with zero in column deletes row that contain 0 in any number
    By Bjordion in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2012, 02:55 AM
  6. Macro to delete certain columns and delete rows based on time in another column
    By beepbeep27 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2012, 11:47 AM
  7. Delete rows containing a number
    By hesham63 in forum Excel General
    Replies: 5
    Last Post: 08-01-2011, 08:29 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