RE: Macro's - inserting a worksheet and having upload data

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: gocush (gocushNOT_THIS_at_comcast.net/delete)
Date: 01/24/05


Date: Sun, 23 Jan 2005 20:47:05 -0800

What you need is a loop that is triggered by ,say a button that is on your
Summary *** - I'll call it Master. In the Master *** lets say you want
cell A1 = the sum of cell A1 in all other sheets. Try this:

Sub AddEmUp()

Dim Sh as Work***
Dim Total as Long

For each Sh in Worksheets
   If Sh.Name<>"Master" then
        Total = Total + Range("A1")
   End if
Next
Sheets("Master").Range("A1") = Total
End Sub
 

"Can't work it out" wrote:

> I have a template work*** that has data on it that a user is required to
> input. I also have a macro that makes a copy of the template work***. For
> arguments sake, the copy of the template work*** may be named "Bob", and
> the user can then input information relating to Bob. An example may be, how
> much money Bob has.
>
> I then have a summary work*** that summarises all of the data in the
> individual worksheets that are created from the template. One of the cells
> may sum the same cell on all of the worksheets in the spreadsheet that have
> been created from the template work***.
>
> I want to have the flexibility to create a new work*** from the template
> work*** and have the summary work*** automatically link in the
> information from the new work***. So, the question is, once i have created
> the new work*** from the template and input the data relating to that
> particular person, how can i have it link directly into some sort of summary
> work*** without having to go and change the formulas in the summary
> spread*** each time a new work*** is added.
>
>
>


Quantcast