ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   copy and autoadjust formula (https://www.excelbanter.com/excel-worksheet-functions/188884-copy-autoadjust-formula.html)

dimitry[_2_]

copy and autoadjust formula
 
I have a workbook with many consecutive sheets (one for each day)In 3
different cells (on the same location in every sheet) there is a
formula, which comes from the previous sheet. Eg: C3Tuesday='Monday!F3.
How can I copy these formulas so that they autoadjust from sheet to
sheet, and I dont have to do it manually. Thanks beforehand

Gord Dibben

copy and autoadjust formula
 
If you're willing to use a User Defined Function.......

Function PrevSheet(rg As Range)
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

=PrevSheet(F3)

Note: you can group the worksheets from 2 onwards and enter the formula on the
activesheet.

Will be entered in all sheets except first sheet.


Gord Dibben MS Excel MVP

On Mon, 26 May 2008 18:13:38 -0300, dimitry wrote:

I have a workbook with many consecutive sheets (one for each day)In 3
different cells (on the same location in every sheet) there is a
formula, which comes from the previous sheet. Eg: C3Tuesday='Monday!F3.
How can I copy these formulas so that they autoadjust from sheet to
sheet, and I dont have to do it manually. Thanks beforehand




All times are GMT +1. The time now is 05:22 PM.

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