PDA

View Full Version : Sleeper: Cell to reference sheet tabs in code.



Sir Babydum GBE
08-17-2005, 08:18 AM
Say Sheet1, A1 has a validation list that contains all the names of the sheet tabs. I select "mySheet" in A1.

How do I get the macro to, say, copy cell B1 on mySheet to A1 on sheet 1? I mean, I know how to hard-wire it, but how do I get it to go to mySheet because it said mySheet in A1 of Sheet1.

So if it said myOtherSheet in A1, then the macro would go to the sheet called myOtherSheet?

Cheers

Bob Phillips
08-17-2005, 09:03 AM
You are tyrying to use Sheet1 A1 for the DV and the value referenced by it. Assuming we use A2 instead, add this formula


=INDIRECT("'"&A1&"'!B1")

Jacob Hilderbrand
08-17-2005, 09:04 AM
So A1 is the value, try this.


Sheets(Range("A1").Text)...

Sir Babydum GBE
08-17-2005, 09:06 AM
Thanks both.

Switching off my PC now and will try your methods out later at home