+ Reply to Thread
Results 1 to 2 of 2

Help Creating Macro to Delete all data except quarterly ends

  1. #1
    Registered User
    Join Date
    07-06-2014
    Location
    Ohio, USA
    MS-Off Ver
    2007
    Posts
    1

    Post Help Creating Macro to Delete all data except quarterly ends

    Hello all,

    Thanks so much for taking the time to help!

    I am trying to create a macro that will delete all rows except for the rows that contain the data for the quarters end (march 31, june 30, sept 30, dec 31) for the past 20 years. The dates are in column A.

    The problem is that because the stock market is only open until friday, some quarters do not have data for the last couple days of the month.
    Example: The last day in September 2012 was Friday the 28th, so the macro needs to recognize that that is still the end of the quarter.

    Now I started going through doing this

    Please Login or Register  to view this content.

    And this works... however I had to manually look up and enter al the dads. I am sure there is a faster way for it to recognize the quarter ends automatically.


    Thanks!

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Help Creating Macro to Delete all data except quarterly ends

    unsure how your data looks like but maybe these two helper columns can extract what you want?

    basically one is to determine last friday of the month
    and the other is to detect if that month is 3,6,9 or 12

    then just filter on column C and you have all your quarters
    Attached Files Attached Files
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ 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] Setting a range that ends where data ends?
    By Mgassma in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-02-2013, 09:46 AM
  2. [SOLVED] Ask: creating the macro to delete half of data and calculate average of the first six row
    By tomama88 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-02-2012, 03:14 PM
  3. [SOLVED] Macro to Copy/Paste Data down to where data in another column ends
    By mclark13 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-07-2012, 04:02 PM
  4. Delete whole if the cell ends with something
    By mthem2003 in forum Excel General
    Replies: 4
    Last Post: 08-18-2009, 09:16 PM
  5. Macro to delete columns if they contain data - need help creating
    By heweaver in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-17-2008, 09:11 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