Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default 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
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
To create an Macro and alco to update an graph Rav Sandhu Excel Discussion (Misc queries) 0 October 16th 07 06:08 PM
Can I create an auto update chart in a template Allan New Users to Excel 0 May 8th 06 09:33 PM
Macro to Create a Chart and Update it Automatically maperalia Charts and Charting in Excel 2 October 21st 05 05:42 PM
Making a spread sheet template Kyle New Users to Excel 1 May 19th 05 03:02 PM
want to create a template and update in seperate worksheet lata New Users to Excel 0 February 23rd 05 07:21 AM


All times are GMT +1. The time now is 07:43 AM.

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

About Us

"It's about Microsoft Excel"