View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default use a variable for a worksheet name in a formula

Try something like this

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

Where A1 contains the Worksheet Name.
--
HTH,
Barb Reinhardt



"caroline" wrote:

Hello,
I would like to use a formula with variable to access worksheets
(Like the VBA Worksheets(Range("a1").Value). I do not want to use VBA
because I need the user to see the formula.

My worksheets are named 'Input','Definition' . . .
I have found this formula in previous answers
=INDIRECT("'sheet (" & A1 & ")'!B1")
but this works only if the worksheets are named 'Sheet (1)','Sheet (2)'

Any idea?
Thanks!


--
caroline