+ Reply to Thread
Results 1 to 6 of 6

Previous Month Filter file based on file name contains month

  1. #1
    Registered User
    Join Date
    02-20-2018
    Location
    London
    MS-Off Ver
    13
    Posts
    3

    Previous Month Filter file based on file name contains month

    Hi guys

    I am looking to select a previous month excel file based on the file name which contains the month name from two folders.

    First folder contains the file name as "File (HFS) Jan-2022" with month in the form mmm- year.
    Second folder contains the file name as "2022 01 rpt final" with year and month in the form of integer.

    Can someone please help me in figuring out how to select the previous month file based on above two examples through vba?

    Thank you

  2. #2
    Registered User
    Join Date
    02-20-2018
    Location
    London
    MS-Off Ver
    13
    Posts
    3

    Re: Previous Month Filter file based on file name contains month

    Can someone please help me in figuring out how to select the previous month file based on above two examples through vba and select the values from column A and save as new file?
    Attached is the sample file

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Previous Month Filter file based on file name contains month

    crossposted: https://www.myonlinetraininghub.com/...ontains-months

    Rule 03: Cross-posting Without Telling Us

    Your post does not comply with Rule 3 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this.

    I have added the crosspost reference for you today. Please comply with this and all our rules in the future
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,798

    Re: Previous Month Filter file based on file name contains month

    And another undeclared cross-post: https://www.mrexcel.com/board/thread...month.1196192/

    Have you asked this anywhere else? If so, you need to tell us, please.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    02-20-2018
    Location
    London
    MS-Off Ver
    13
    Posts
    3

    Re: Previous Month Filter file based on file name contains month

    All, understood about cross posting apologies - I had figured it out using:



    For anyone who is in the same situation as my question, here is what I found from online



    This has helped to solve my issue. I created the path name using format function using date and managed to sort it.



    Happy helping others people !!

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,798

    Re: Previous Month Filter file based on file name contains month

    You haven't shared anything! So, no, that's no help at all.

    Please post the links with TWO spaces added to them, then I will fix them for you, as you are not allowed to post links here yet.

+ 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: 04-25-2021, 05:50 AM
  2. [SOLVED] Manipulating previous month file
    By saechaoc in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-23-2015, 02:46 PM
  3. [SOLVED] Formula for amount on previous month based on current month
    By Yu Marquez in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-21-2014, 12:42 AM
  4. 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
  5. Replies: 4
    Last Post: 09-09-2013, 05:06 AM
  6. [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
  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

Tags for this Thread

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