PDA

View Full Version : Macro to change month and year on all sheet



Howardc
08-14-2013, 05:26 PM
I have a formulas that links to a particular sheet see eg =IF('Jul-2013'!G100>0,('Jul-2013'!G100),"")

I would like a macro that will enable me to replace the month and year and all sheets with the name ending in JNL

I have attached a sample workbook. For the sample I only have one sheet with the name ending in JNL, but in practice I will have several sheets with the name ending in JNL

Your assistance in this regard is most appreciated

Dexter1759
08-15-2013, 01:12 PM
Have you thought about using the INDIRECT formula?

For example, instead of your formula:

='Mar-2013'!C42

You could use:

=INDIRECT("'" & A7 & "'!C42")

Where the value of A7 would be "Mar-2013".

It really depends on the usage.

Dex

Howardc
08-15-2013, 05:58 PM
Hi Dex

Thanks for the help, much appreciated. It makes sense to use this formula

Regards

Howard