G
gautamghodadra
How do I pick up info from a cell from the sheet to the next sheet at
the same location and in th esame workbook?
the same location and in th esame workbook?
Gord said:I may have misinterpreted but..............
In Sheet2 select A1 and enter =Sheet1!A1
Gord Dibben MS Excel MVP
Thanks.
I am confused.
You have a workbook with a couple of sheets in it....right?
You are sending the workbook or one sheet to a user?
Which of the above applies?
Where are the 2006 and 2007 sheets? In one workbook or two?
You don't know what the user has named a sheet? Which sheet?
In cases where you don't know the name of the previous sheet you could use a
user defined function.
Function PrevSheet(rg As Range)
Application.Volatile
n = Application.Caller.Parent.Index
If n = 1 Then
PrevSheet = CVErr(xlErrRef)
ElseIf TypeName(Sheets(n - 1)) = "Chart" Then
PrevSheet = CVErr(xlErrNA)
Else
PrevSheet = Sheets(n - 1).Range(rg.Address).Value
End If
End Function
Enter =PrevSheet(B2) on target sheet and you'll get B2 from sheet to
left(previous)
How-to install a UDF.
With your workbook open....................
Hit Alt + F11 to open the Visual Basic Editor. CTRL + r to open the Project
Explorer.
Select your workbook/project and Insert>Module
Copy/paste the above UDF into that module.
Alt + q to return to Excel
Enter the formula as above in the target sheet.
Gord Dibben MS Excel MVP