+ Reply to Thread
Results 1 to 3 of 3

Delete Rows in Sequence

  1. #1
    Registered User
    Join Date
    10-02-2009
    Location
    Arlington, VA, USA
    MS-Off Ver
    Excel 2003
    Posts
    34

    Delete Rows in Sequence

    I'm having difficulty with some data that is not on the same timeline. One series is monthly and the other is quarterly. My original thought was to convert the quarterly to monthly via estimation, but that might be overly complicated. It might be simpler to convert the monthly data to quarterly data by deleting the non-congruous months.

    So I need a macro that will allow me to delete two out of every three months. For instance, if I only need January, April, July, and October data, I would need to delete the other months.

    Here's what my data looks like:

    Jan-1949 1.3%
    Feb-1949 1.3%
    Mar-1949 1.7%
    Apr-1949 0.4%
    May-1949 -0.4%
    Jun-1949 -0.8%
    Jul-1949 -2.9%
    Aug-1949 -2.9%
    Sep-1949 -2.4%
    Oct-1949 -2.9%
    Nov-1949 -1.7%
    Dec-1949 -2.1%
    Jan-1950 -2.1%
    Feb-1950 -1.3%
    Mar-1950 -0.8%
    Apr-1950 -1.3%
    May-1950 -0.4%
    Jun-1950 -0.4%
    Jul-1950 1.7%
    Aug-1950 2.1%
    Sep-1950 2.1%
    Oct-1950 3.8%
    Nov-1950 3.8%
    Dec-1950 5.9%
    Here's what I need it to look like after the deletions:

    Jan-1949 1.3%
    Apr-1949 0.4%
    Jul-1949 -2.9%
    Oct-1949 -2.9%
    Jan-1950 -2.1%
    Apr-1950 -1.3%
    Jul-1950 1.7%
    Oct-1950 3.8%
    How would I design a macro to do this?

  2. #2
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Delete Rows in Sequence

    Hi Jakila23

    Let your data will be in sheet1 in column A

    Try this code for delete rows you need. Copy it to Module and start delete_rows()

    Please Login or Register  to view this content.
    Best Regards

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Delete Rows in Sequence

    Assuming these data in 1 column:

    Please Login or Register  to view this content.



+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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