ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Indirect sheet reference in a cell (https://www.excelbanter.com/excel-worksheet-functions/182075-indirect-sheet-reference-cell.html)

velvetlady

Indirect sheet reference in a cell
 
Is there a way to write an equation to use the values from a specific cell on
another worksheet without using the worksheet name. i.e. reference it by
position in the workbook, such as "Sheet(1)" as is done in Visual Basic?
--
jwm

Gary''s Student

Indirect sheet reference in a cell
 
First enter this UDF:

Function sheetname(i As Integer) As String
sheetname = Sheets(i).Name & "!"
End Function

and then:

=INDIRECT(sheetname(1) & "A9") will return the value in cell A9 in the first
worksheet.
--
Gary''s Student - gsnu200776


"velvetlady" wrote:

Is there a way to write an equation to use the values from a specific cell on
another worksheet without using the worksheet name. i.e. reference it by
position in the workbook, such as "Sheet(1)" as is done in Visual Basic?
--
jwm



All times are GMT +1. The time now is 04:25 PM.

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