Macro to generate repetitive formulas?

ljones123

New Member
Joined
Feb 24, 2014
Messages
3
I have a master sheet (Master) that references another workbook (Details) that I use for inventory control. Details has a separate sheet for each part number (Part 1, Part 2, etc.). When a new quantity of Part 1 is entered (in cell A1, Part 1 tab, Details workbook) I want it to show up on the Master sheet. The link on the Master sheet would look like this:

=’[Details.xlsx]Part 1’!$A$1

Subsequently, the link to the next part would be:
=’[Details.xlsx]Part 2’!$A$1

And so on. My problem is that I have hundreds of lines on my sheet, and simply dragging the formula does not change the tab number, which is the only part of the formula I need to change. Is there a macro to generate these formulas so I don’t have to manually change it to Part 3, Part 4 and so on? I know enough excel to be dangerous, so I need expert help. I also need to know if there would be a better approach or formula to return the desired value. Thanks for your help!
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
If your Details.xlsx workbook is open, you could use INDIRECT:

=INDIRECT("'[Details.xlsx]Part " &ROWS($A$1:A1)&"'!A1")

Copy down.
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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