View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default macro to link worksheets

Couple of questions Todd.

When you add a new sheet there will be no customer information in it so what is
there to add to the summary sheet?

Is the added sheet a copied one or a new one?

This macro will add a sheet and enter the formula into the last cell in Summary
Sheet column A and copies across to column G

Sub add_copy()
Dim newsheet As Worksheet
Set newsheet = Sheets.Add
Set rng = Sheets("Summary").Cells(Rows.Count, 1).End(xlUp) _
.Offset(1, 0)
rng.Formula = "=" & newsheet.Name & "!A1"
Sheets("Summary").Range(rng.Address & ":G" & rng.Row).FillRight
End Sub


Gord Dibben MS Excel MVP


On Thu, 6 Dec 2007 13:18:03 -0800, Todd wrote:

I'm creating a spreadsheet that will have several worksheets added over time.
i.e. a new worksheet for each new customer. All of the individual
worksheets will have the customers information added to it when it is
received.

There will be a summary sheet added to create a master list of all customers
and their basic info...Name, Location, Contact Name....etc.

How would I write a simple macro that will take the customer basic info and
add it to the summary sheet each time a new worksheet is added? Basically
just a macro that will enter the formula ='Customer (1)'!A1 into the
summary sheet from the customer sheet.