Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Tia Tia is offline
external usenet poster
 
Posts: 64
Default formula reference between worksheets

I have a workbook where Tab1 is a "reference" page, with each row of data
containing an associate record. In Tab2 - Tab50, I need to "plug in" the
same piece of information on a form copied from the prior tab. Currently I
will copy Tab2 to Tab3 and incrementally change the cell refence by 1. Rather
than change this manually, is there a formula or macro that can do this for
me?
--
Tia
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default formula reference between worksheets

Tia

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

Say you have 50 sheets, sheet1 through sheet50...........sheet names don't
matter.

Select second sheet and SHIFT + Click last sheet

In B1 enter =PrevSheet(A1)

Ungroup the sheets.

Each B1 will have the contents of the previous sheet's A1

Copy/paste the UDF above into a General Module in your workbook.

If not familiar with macros and VBA, visit David McRitchie's website on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the above code in there. Save the
workbook and hit ALT + Q to return to your workbook.


Gord Dibben Excel MVP

On Wed, 3 Jan 2007 11:48:02 -0800, Tia wrote:

I have a workbook where Tab1 is a "reference" page, with each row of data
containing an associate record. In Tab2 - Tab50, I need to "plug in" the
same piece of information on a form copied from the prior tab. Currently I
will copy Tab2 to Tab3 and incrementally change the cell refence by 1. Rather
than change this manually, is there a formula or macro that can do this for
me?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lookup Data in two seperate Spreadsheets Padraig Excel Worksheet Functions 6 June 28th 06 03:05 PM
Maintain Formula Reference (sort of) JimK Excel Worksheet Functions 2 June 7th 06 05:14 PM
Worksheet name / reference as a formula? gabriel_e Excel Discussion (Misc queries) 4 January 24th 06 12:23 PM
Copying a Formula To Reference Multiple Worksheets carl Excel Worksheet Functions 1 August 5th 05 01:06 AM
use central formula on many worksheets, central affect allsheets MidNiteRaver Excel Worksheet Functions 0 July 25th 05 06:08 PM


All times are GMT +1. The time now is 02:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"