Filter month based on file name contains month

learn2power

New Member
Joined
Nov 19, 2021
Messages
5
Office Version
  1. 2016
  2. 2013
Platform
  1. Windows
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) Dec-2021" with month in the form mmm- year
Second folder contains the file name as "2021 12 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 and select the values from column A and save as new file?

Thank you
 

Attachments

  • First Folder Sample.png
    First Folder Sample.png
    7.1 KB · Views: 8
  • Second Folder Sample.png
    Second Folder Sample.png
    3.8 KB · Views: 8

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Previous Month Filter file based on file name contains month
and https://www.myonlinetraininghub.com...lter-month-based-on-file-name-contains-months
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0
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 !!
 
Upvote 0
Solution

Forum statistics

Threads
1,213,522
Messages
6,114,112
Members
448,549
Latest member
brianhfield

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top