Formulating between worksksheets

  • Thread starter Thread starter Jozmoz
  • Start date Start date
J

Jozmoz

I'm trying to formulate a cell on the second worksheet that includes a
calculation from a cell from the previous worksheet. how do I write the
formula so it knows that a cell is on the previous worksheet?
 
Let excel work for you.

Start your formula (I'm gonna use =sum() as the function that will be used on
the other sheet's cells):


=A1+B9+Sum(

Now use the mouse to select that range on the other sheet:
I got
=A1+B9+SUM(Sheet1!B7:B17

Then hit enter (to be prompted to let excel finish the formula)

or type the close parenthesis to continue typing the rest of your formula:

=A1+B9+SUM(Sheet1!B7:B17)+sum(q3:q99)
 
You could use this User Defined Function.

Function PrevSheet(rg As Range)
'Enter =PrevSheet(B2) on sheet2 and you'll get B2 from sheet1.
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


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Multiple criteria question 1
min ,max,average 2
copying data between worksheets 2
Excel VBA 1
Date/ Time Formula in Excel 2
Formulate Entire Sheet 1
Excel Highlighting duplicates 0
Conditional formatting between worksheets 2

Back
Top