ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Cell reference - for the sheet name, can I use a variable? (https://www.excelbanter.com/excel-discussion-misc-queries/1774-cell-reference-sheet-name-can-i-use-variable.html)

Matt Lawson

Cell reference - for the sheet name, can I use a variable?
 
For example, I know I can refer to another worksheet in a cell formula as such:
=Data!C6

However, Is there a way to refer to the name of the sheet based on the name
of the sheet being a variable (ie. the contents of another cell?)

THanks

Matt Lawson



Frank Kabel

Hi
=INDIRECT("'" & A1 & "'!C6)
where A1 stores your sheet name

"Matt Lawson" wrote:

For example, I know I can refer to another worksheet in a cell formula as such:
=Data!C6

However, Is there a way to refer to the name of the sheet based on the name
of the sheet being a variable (ie. the contents of another cell?)

THanks

Matt Lawson



Matt Lawson

Thanks again for the help Frank!

I get a "formula you typed contains an error".. I did replace A1 with the
correct cell. I looked up the reference in help, and I'm not sure how you are
using the INDIRECT function.

Thanks

Matt Lawson

"Frank Kabel" wrote:

Hi
=INDIRECT("'" & A1 & "'!C6)
where A1 stores your sheet name

"Matt Lawson" wrote:

For example, I know I can refer to another worksheet in a cell formula as such:
=Data!C6

However, Is there a way to refer to the name of the sheet based on the name
of the sheet being a variable (ie. the contents of another cell?)

THanks

Matt Lawson



Bob Phillips

Matt,

It should be

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

not the single quotes as well as the doubles.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Matt Lawson" wrote in message
...
Thanks again for the help Frank!

I get a "formula you typed contains an error".. I did replace A1 with the
correct cell. I looked up the reference in help, and I'm not sure how you

are
using the INDIRECT function.

Thanks

Matt Lawson

"Frank Kabel" wrote:

Hi
=INDIRECT("'" & A1 & "'!C6)
where A1 stores your sheet name

"Matt Lawson" wrote:

For example, I know I can refer to another worksheet in a cell formula

as such:
=Data!C6

However, Is there a way to refer to the name of the sheet based on the

name
of the sheet being a variable (ie. the contents of another cell?)

THanks

Matt Lawson





Frank Kabel

Hi Bob
thanks for the correction :-)


"Bob Phillips" wrote:

Matt,

It should be

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

not the single quotes as well as the doubles.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Matt Lawson" wrote in message
...
Thanks again for the help Frank!

I get a "formula you typed contains an error".. I did replace A1 with the
correct cell. I looked up the reference in help, and I'm not sure how you

are
using the INDIRECT function.

Thanks

Matt Lawson

"Frank Kabel" wrote:

Hi
=INDIRECT("'" & A1 & "'!C6)
where A1 stores your sheet name

"Matt Lawson" wrote:

For example, I know I can refer to another worksheet in a cell formula

as such:
=Data!C6

However, Is there a way to refer to the name of the sheet based on the

name
of the sheet being a variable (ie. the contents of another cell?)

THanks

Matt Lawson







All times are GMT +1. The time now is 07:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com