Changing formulas automaticly from an exterior reference.

gausepohl

New Member
Joined
Jan 21, 2005
Messages
2
OK, i am trying to creat a system where i have a log page fill automaticly from source pages in other workbooks. Now what i would like to do (and half done) is only have one log page fill from the data cells that are constant from other notbooks depending on the month needed.

so for instance one link i have goes like this..

='[Test 2G WORKBOOK.xls]DCA & Primary CS alloc 11'!$BD$14

now this is for nevember inicated by the 11 before the cell reference,
now the information i need for october is the the exact same cell location
$BD$14, But it is in worksheet 10. so the link for that is...

='[Test 2G WORKBOOK.xls]DCA & Primary CS alloc 10'!$BD$14

see exactly the same only the number at the end of the worksheet.
My question is, i have a combo bar that manually changes the date on the logsheet. Is there anyway i can set up somthing so that it will change my formula's 2 digit month reference automaticly with the changing of the date. or any other simple way so that i don't have to change them all manually. PLEASE HELP ME I"M DISABLED! (Not really)
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

chiello

Well-known Member
Joined
Jan 18, 2005
Messages
848
Re: Changing formulas automaticly from an exterior reference

Suppose you have your formula in cell A1 and date in cell A2. Add the following code to the change event routine of your combo:

Private Sub ComboBox1_Change()
Dim IdMonth As Long

IdMonth = Month(Range("A1"))
Range("A1").FormulaR1C1 = _
"='[Test 2G WORKBOOK.xls]DCA & Primary CS alloc " & IdMonth & "'!$BD$14"

End Sub
 

gausepohl

New Member
Joined
Jan 21, 2005
Messages
2
ok .....
can one please expalin that in reguler words.
or even better just tell me what i have to do??
 

chiello

Well-known Member
Joined
Jan 18, 2005
Messages
848

chiello

Well-known Member
Joined
Jan 18, 2005
Messages
848
Re: Changing formulas automaticly from an exterior reference

:devilish:

OK, I hope this solution satisfies your request:
assume you have month information in cell A1 (11 for Nov, 12 for Dec and so on). Enter the formula below in your link:

=INDIRECT("'[Test 2G WORKBOOK.xls]DCA & Primary CS alloc "&$A$1&"'!$BD$14")
 

Forum statistics

Threads
1,147,622
Messages
5,742,197
Members
423,711
Latest member
luisfreitas

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
Top