ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Copying and adjusting formulas (https://www.excelbanter.com/excel-worksheet-functions/197354-copying-adjusting-formulas.html)

dimitry

Copying and adjusting formulas
 
I have a workbook made of a lot of consecutive sheets( each one a date).
I use a formula [f4 of the present sheet= h4 of the previous sheet]
meaning my actual stock is the remaining o the previous. I am looking
for a way to copy the formula [and update] to consecutive sheets. At
presen I have to go one by one. Any hints? Thanks beforehand.

Dimitry

Gord Dibben

Copying and adjusting formulas
 
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(H4) entered in F4

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 Sat, 02 Aug 2008 15:26:14 -0300, dimitry wrote:

I have a workbook made of a lot of consecutive sheets( each one a date).
I use a formula [f4 of the present sheet= h4 of the previous sheet]
meaning my actual stock is the remaining o the previous. I am looking
for a way to copy the formula [and update] to consecutive sheets. At
presen I have to go one by one. Any hints? Thanks beforehand.

Dimitry




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

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