+ Reply to Thread
Results 1 to 13 of 13

Manipulating previous month file

  1. #1
    Registered User
    Join Date
    06-15-2015
    Location
    Seattle
    MS-Off Ver
    2013
    Posts
    62

    Manipulating previous month file

    My issue is that I need to access the last months file titled "blah purchase forecast whatever was last Month current Year"

    Is there a way to access the files with only knowing the current month?

    It's stored in something like this

    P:\Supply Chain\SCP\nomnom\blah\blahza\ABC Forecasts 2015\
    Last edited by saechaoc; 07-22-2015 at 06:05 PM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Manipulating previous month file

    Hi saechaoc

    What does the actual File Name look like?

    Is it in the same Folder as the Workbook (ThisWorkbook) running the Code?

    What do you want to do with "blah purchase forecast whatever was last Month current Year"...open it?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    06-15-2015
    Location
    Seattle
    MS-Off Ver
    2013
    Posts
    62

    Re: Manipulating previous month file

    Jaslake,

    I will be grabbing data from the workbook. I do not have a problem with that but I don't know how to refer to the last month and current year of the given file. Yes it will be in the same folder ie. P:\Supply Chain\SCP\nomnom\blah\blahza\ABC Forecasts 2015\

    The file name would look like this:

    P:\Supply Chain\SCP\nomnom\blah\blahza\ABC Forecasts 2015\blah purchase forecast whatever was last Month current Year.xlsx

    To be more explicit consider:

    P:\Supply Chain\SCP\nomnom\blah\blahza\ABC Forecasts 2015\blah purchase forecast June 2015.xlsx
    Last edited by saechaoc; 07-22-2015 at 06:15 PM.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Manipulating previous month file

    Hi saechaoc

    I know this as you've mentioned it before
    blah purchase forecast whatever was last Month current Year.xlsx
    What does an ACTUAL FILE NAME look like?

    Edit:
    I see your edited response...Thanks...

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Manipulating previous month file

    Hi saechaoc

    This Code will open the prior Months Workbook...

    Please Login or Register  to view this content.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Manipulating previous month file

    Hi saechaoc

    What do you wish to do when the current month is January?

  7. #7
    Registered User
    Join Date
    06-15-2015
    Location
    Seattle
    MS-Off Ver
    2013
    Posts
    62

    Re: Manipulating previous month file

    Hello, thank you for the help.

    I would like to activate the previous month of the last year if that's possible.

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Manipulating previous month file

    Hi saechaoc

    Not tested...try this...
    Please Login or Register  to view this content.
    Last edited by jaslake; 07-23-2015 at 01:39 PM.

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Manipulating previous month file

    Sorry...that should have been
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    06-15-2015
    Location
    Seattle
    MS-Off Ver
    2013
    Posts
    62

    Re: Manipulating previous month file

    Thanks I think this should work! But I've got a general outline and syntax for everything I need.

  11. #11
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Manipulating previous month file

    It may work but I think this Line of Code should read
    Please Login or Register  to view this content.
    instead of
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    06-15-2015
    Location
    Seattle
    MS-Off Ver
    2013
    Posts
    62

    Re: Manipulating previous month file

    yeah I already fixed it thank you!

  13. #13
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Manipulating previous month file

    You're welcome...glad I could help. Thanks for the Rep.

+ 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. Replies: 1
    Last Post: 07-06-2015, 04:43 PM
  2. VBA to return previous month date when opening file
    By jonathan.haynes in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-29-2013, 10:53 AM
  3. Macro using vlookups comparing 2 months paysheet(previous month and current month)
    By srinivasan1965 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-07-2012, 03:45 AM
  4. Replies: 5
    Last Post: 10-04-2012, 07:06 AM
  5. [SOLVED] VBA to identify the current month and previous month based on system date
    By ravikumar00008 in forum Excel General
    Replies: 10
    Last Post: 07-26-2012, 10:04 AM
  6. Replies: 4
    Last Post: 03-19-2012, 08:58 AM
  7. Saveas with previous month in file name
    By dnyhof in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-12-2011, 12:44 AM

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