View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike1558 Mike1558 is offline
external usenet poster
 
Posts: 12
Default transfering cell values progressively through worksheets

Gord
Thanks for your help, I understand what you are doing in the second half of
problem 1 but am unsure of what you want me to do in the 1st half of problem
1. What is a UDF and a general module of a work book and then what does it do
and how do I use it? I am guessing that this is code that is to be entered
into the workbook but I am unsure of how to do it.
--
Thanks again
Mike


"Gord Dibben" wrote:

Problem number 1..........updating formulas to refer to previous month.

Copy/paste this UDF to a general module in your workbook.

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

Example of usage...................

Say you have 12 sheets, sheet1 through sheet12...........sheet names don't
matter.

In sheet1 you have a formula in A10 =SUM(A1:A9)

Select second sheet and SHIFT + Click last sheet

In active sheet A10 enter =SUM(PrevSheet(A10),A1:A9)

Ungroup the sheets.

Each A10 will have the sum of the previous sheet's A10 plus the sum of the
current sheet's A1:A9

Problem number 2..............selection of multiple cells

Try setting the Zoom level a little higher or lower to stop the multiple
cell selecting.


Gord Dibben MS Excel MVP

On Sat, 27 Jun 2009 07:30:01 -0700, Mike1558
wrote:

What I am doing is, say for the pay-app month May, I have a cell that
contains the total amount of a line item for this draw period. The next cell
in the row contains a formula that gives the results for the amount for this
line item spent to date. To one of the values in "spent to date" cell comes
from the same cell in a previous worksheet "April". Once the "May" worksheet
is done and I move on to create the "June" worksheet the "May" amount now
becomes a value in the "June" worksheet. This happens progressively through
the completion of the job. Do you have a suggestion? Would it be helpful to
see what I am working on?
I really appreciate any help you can give me.
Also I am having an annoying problem with all my excel workbooks, I have
office 2007, when I try to select a single cell it selects multiple cells
then what I do is move the curser to the lower right hand corner of the cell
that I want to select and I have to keep clicking on it until the single cell
that I want is selected. This usually takes several attemps because a cell in
the vacinity of the cell that I want gets selected not the cell that I want.
Any suggestions?