0

I have one workbook(I will call it "master" ) with multiple sheets, each is linked to different workbooks in same folder. Every month I make new folder and copy the content of old folder to the new one. Basically I have folder with path "/path/1"(number represents the month) and every month I want to change it to "/path/2" ...then from "/path/2" to "/path/3" etc. How would I do that using macro? My idea is that I would have a cell with name of the new folder. And my macro would change the path accordingly. Could you help me?

2
  • So basically you want to change formula with path, am I right? Commented Aug 9, 2014 at 9:53
  • @Iowak yes, but it's not even real formula in master WB I just have linked cell like =path/1......C1 Commented Aug 9, 2014 at 9:55

1 Answer 1

2

Ok, your path should something look like this:

ActiveCell.FormulaR1C1 = "='C:\Users\My_user\Desktop\example_folder\1\[Testowanie_fak1.xlsm]Test'!R1C1"

If you want to change the path so your cells will be linked to a different folder all you need to do this is change the formula just a little bit. In this case I added Month(Date) which will automatically add number with current month (so now it will add 8).

ActiveCell.FormulaR1C1 = "='C:\Users\My_user\Desktop\example_folder\" & Month(Date) & "\[Testowanie_fak1.xlsm]Test'!R1C1"
Sign up to request clarification or add additional context in comments.

2 Comments

I am sorry for not replying sooner, thank you for your answer, I will try it tomorrow :)
I played with it today, and it seems to be working just like I want. Thank you once again

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.