How to replace sheet name in a formula?

J

js

Hi,
How to replace sheet name in a formula?
Say, I have 3 sheets named Sheet A, Sheet B, and Sheet C.
D5 contents a formula VLOOKUP(A5,'Sheet A'!$B$7:$F$36,2,FALSE). If I type
"Sheet B" in A1, "Sheet A" in the formula is replaced automatically by A1
content.

thanks
js
 
P

papou

Hello

=VLOOKUP(A5,INDIRECT("'"&A1&"'!$B$7:$F$36",TRUE),2,FALSE)

HTH
Cordially
Pascal
 
Top