PDA

View Full Version : VBA formula that creates new workbook from 1 sheet after 1 cell is updated and refres



NSP27
04-26-2023, 11:07 AM
Hi guys!

I'm new in the VBA world, and I have a challenge on my hands, and having difficulties completing it.

I have a Excel sheet (Master) with some formulas depending on the value of a specific Cell (Example Cell B3).

In another sheet (Values) I have a list of values (Example Range A2:A30).

My goal is to build a macro that does the following sequence:

1 - Copy 1st value of the list (Sheet "Values" Cell A2)
2 - Paste on cell that has formulas depending on it (Sheet "Master" cell B3)
3 - Refresh Calculations (Shift + F9)
4 - Save a Pasted-Values Copy of the Master Sheet in a new Workbook named as the Value of the List copied on Step 1
5 - Loop the steps above for the remaining values of the Range A2:A30 until it uses all values from the range.


Can you please help?

Thanks a lot!
NSP

Aussiebear
04-26-2023, 11:57 AM
Welcome to VBAX forum NSP27. A couple of things here for you to consider.

1. A "Formula" won't do what you are asking, rather a Macro will;

2. 29 new workbooks.... that's going to take some managing don't you think? Would you not be better off with a new workbook with 29 sheets?

3. Since you are new to VBA, have you considered using the VBA Macro Recorder to try out your concept?

NSP27
04-26-2023, 01:10 PM
Welcome to VBAX forum NSP27. A couple of things here for you to consider.

1. A "Formula" won't do what you are asking, rather a Macro will;

2. 29 new workbooks.... that's going to take some managing don't you think? Would you not be better off with a new workbook with 29 sheets?

3. Since you are new to VBA, have you considered using the VBA Macro Recorder to try out your concept?

Hello!

1 - Yes, I wanted to say Macro Code :)
2 - Nop, the output needs to be separated in different workbooks because this is information that will be sent to 29 different persons.
3 - Yes, it was my first attempt, but without Success... If the List from Sheet "Values" changes (and it will), the macro does not work anymore

Thank you for your time and availability to help me!

Best regards

Aussiebear
05-11-2023, 05:10 PM
Sorry for the delay in getting back to you. Would it be possible to attach a sample workbook so we can see what you are trying to achieve?