PC Pals Forum
Technical Help & Discussion => Windows PCs & Software: Help, News & Discussion => Topic started by: DJ on January 24, 2006, 22:54
-
Hi All,
I need to be able to reference a sheet name in my formula, dependant on what the user enters in a cell. Let me explain.
Say I have a workbook with Sheets named Summary, Jan, Feb and Mar.
The formula I could use on a Summary sheet is like...
=Jan!A1 + A2
But I want to control this by the users data entry in a cell adjacent to this, so that whatever is entered in a cell replacess the "Jan" bit.
So if the data is entered in cell D1 I thought I could use
='D1'A1 + A2
But it doesn't seem to work - can anyone shed any light? I hope I have explained this ok.
Basically the sheets can be named anything and so the forumla to calculate this needs to be altered each time - so referencing to another cell would be ideal.
Thanks
DJ
-
Without knowing exactly what your parameters are, my meagre knowledge is insufficient :( . Nevertheless, I'm sufficiently confident (after a night out dancing and at the pub :oops:) to suggest the answer might lie in the 'And' argument.
Gill
-
All I want to do is replace the Sheet name (Jan!) with a cell reference (e.g. D1). So that whatever is typed in D1 is a sheet name.
DJ
-
DJ,
Does this seem right :wink:
A formula to put the sheet?s name into a cell
=RIGHT(CELL(?filename?,A1),LEN(CELL(?filename?,A1))-FIND(?]?,CELL(?filename?,A1)))
The CELL() function with the ?filename? argument will return the full path of the workbook plus the sheet name. The workbook will be enclosed in brackets []. This formula finds the right bracket (]) and returns everything after that.
Note that if the workbook has not been saved, there is no path, and this formula returns a #Value error.
TR
Or have I got the wrong end of the stick again :twisted:
-
Nope - thats exactly the right end of the stick!!
Thanks TR
DJ
-
Oh, well done, Terry! We know who to come to with Excel queries now. :thumb:
-
Lucky Guess I guess 8)
But then again :wink:
Phewwww another bluff :nerd:
Where's the sticky out toungue when you want it :twisted:
-
What, this one? :tongue: