+ Reply to Thread
Results 1 to 3 of 3

Macro to Retrieve Data with Start Year and End Year

  1. #1
    Forum Contributor
    Join Date
    04-20-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    160

    Macro to Retrieve Data with Start Year and End Year

    Hi,

    I have a worksheet that has row titles in ROW 2 starting from “A2” through “AR2”. My data has thousands of records and always begins in ROW 3. For the purposes of this macro the only columns that matter are "O" through "AR". Columns “O” through “AR” have Years (e.g. 2002, 2003, 2004, etc…) as row titles. The Year row titles start from 2002 (Column “O”) to 2031 (Column “AR”).

    I want to create a macro with Two Input Boxes that allow me to select all the data between a Start Year and an End Year. So for example if my Start Year is 2005 and my End Year is 2010, the macro would only give me back the Years 2005, 2006, 2007, 2008, 2009 and 2010 along with the associated data that pertains to those Years.

    Additionally, I would want the macro to delete the Years from 2002 through 2004 along with its associated data and also Years 2011 through 2031 along with its associated data. Once these are deleted the Years 2005 through 2010 will shift left and start at column “O” through column “T”.

    As part of this post I provide a visual example of what I just described above in the attached workbook "Visual".
    Attached Files Attached Files
    Last edited by boldcode; 04-17-2013 at 01:11 PM. Reason: Solved

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,606

    Re: Macro to Retrieve Data with Start Year and End Year

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    04-20-2011
    Location
    New York, New York
    MS-Off Ver
    Excel 2010
    Posts
    160

    Re: Macro to Retrieve Data with Start Year and End Year

    Thank you AlphaFrog, it works great!

+ 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