Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Making a macro on a template update with new each new sheet create
I recorded a macro on a template I created to transfer data from a cell on
the template I used onto the next available cell in a column in a different workbook. However I have done something wrong because when I open a new file off of the template I created it doesn't transfer data off the new file - it copies it off the template (which has no data in it so it copies 0). Does anyone know how to make a macro update with the file it is in? This is the macro I recorded: Sub Macro2() ' ' Macro2 Macro ' Macro recorded 10/08/2009 by MDouse ' ' Workbooks.Open Filename:="\\server1\Profiles\MDouse\My Documents\Book1.xls", _ UpdateLinks:=0 Columns("A:A").Select Selection.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase _ :=False, SearchFormat:=False).Activate ActiveCell.Replace What:="", Replacement:="=[templatetest.xlt]Sheet1!$A$2" _ , LookAt:=xlWhole, SearchOrder:=xlByColumns, MatchCase:=False, _ SearchFormat:=False, ReplaceFormat:=False Selection.FindNext(After:=ActiveCell).Activate Range("G1").Select ActiveWorkbook.Save ActiveWindow.Close Range("A2").Select End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
To create an Macro and alco to update an graph | Excel Discussion (Misc queries) | |||
Can I create an auto update chart in a template | New Users to Excel | |||
Macro to Create a Chart and Update it Automatically | Charts and Charting in Excel | |||
Making a spread sheet template | New Users to Excel | |||
want to create a template and update in seperate worksheet | New Users to Excel |