How to copy from different files and maps based on the week number in VBA

Bassie

Board Regular
Joined
Jan 13, 2022
Messages
66
Office Version
  1. 2019
Platform
  1. Windows
Hey everyone,

I would like to make a macro that searches every folder within a folder that has a folder with the current weeknumber in it (let me explain).

- I currently have a folder with the names of each of my colleagues as seperate folders and 1 folder that is titled "archive".
1645441605167.png

- Every colleagues folder has folders in it with the week numbers. For example my folder had 3 folders called: "week 6" "week 7" "week 8", but more will be added down the line
1645441650404.png


- I want to extract information from all excel files that are in the current week number for every colleague (week 7 in the example). The folder "archive" should be excluded and new colleague will be added down the line.
I want to do this for every colleague at the same time
1645441725811.png


Is there an easy way to do this?

Thanks a lot in advance and if my explanation wasnt clear I can always answer questions.
Bassie
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hey,​
just use a string variable to store the name of the expected week​
then use the Dir VBA function to store the folders of the root folder in a string array variable​
then use a For Each loop on this string array variable to list each week folder content by combinating the array content & the string week variable …​
 
Upvote 0
Hey,​
just use a string variable to store the name of the expected week​
then use the Dir VBA function to store the folders of the root folder in a string array variable​
then use a For Each loop on this string array variable to list each week folder content by combinating the array content & the string week variable …​
I am having a similar issue, does this advise apply to the post I just made? thanks

 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,626
Members
449,093
Latest member
catterz66

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