Loop through folder names and execute code if folder name matches from specified name

helpmeplease

New member
Joined
Apr 13, 2018
Messages
1
Reaction score
0
Points
0
Hello all,

I am new to VBA coding. I had taken a programming course almost 6 years ago and never touched it since but I would like to start learning slowly to automate a lot of my excel stuff.


I am looking for help to code the following the scenario:

I have 10 folders in a particular location on the drive. Out of the 10, there 7 which are named Item 1, Item 2, Item 3, Item 4, Item 5, Item 6 and Item 7. The remaining three are not to be worried about.

I am hoping to code in VBA such that the code would loop through all the folders and if the folder name matches - Item 1, Item 2, Item 3, Item 4, Item 5, Item 6 and Item 7 - execute code A for folders Item 1, Item 2, Item 3 and then execute code B for Item 4, Item 5, Item 6 and Item 7.

Requesting your kindest help.

Thank you !
 
Back
Top