Avatar of Rayne
Rayne
Flag for United States of America asked on

Hello Gurus

Hello All,

i have a VBA question  -

A)      These are 3 folders in a drive with folder names following the naming convention like below…

C:\WW\2014.09.09 DA 10 XLS
C:\WW\2014.10.09 DA 11 XLS
C:\WW\2014.11.12 DA 12 XLS

----------------------------------------------------------------------------------------------------

B)      Now there is an excel file (“MAIN”) that has info like below – this basically tells which account belongs in which cycle respectively….

Account      | Cycle
Ac1      |         10
Ac2      |         10
Ac3      |         11
      

-------------------------------------------------------------------------------------------------
C)      Now in a certain separate folder  (C:\RAW\) - there are multiple xls files (specific to accounts) with naming convention such that it has the [account] names included in their filename like this:

Fl_Ac1.xls
fl_Ac2.xls
fl_Ac3.xls

----------------------------------------------------------------------------------------------------
I need VBA to do the following – what macro can I give in the file of step B so that on pressing the button, it loops through the multiple files in folder C:\RAW\ and then looks up the account name in list of sheet A (step B) and then locates the cycle ID, to finally put that file in the respective destination folder in C:\WW\ ---

For example – if the code loops through the file   fl_Ac1.xls – it looks up the cycle ID for Ac1 in “MAIN” file and finds that cycle is 10 – then it copies the file – fl_Ac1.xls into the folder  C:\WW\2014.09.09 DA 10 XLS folder….


Thank you
Rayne
Book1.xlsx
Microsoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Rayne

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Lucian Constantin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Rayne

ASKER
Thank you :)
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes