
macro changing code in another macro
For clarification, I am trying to write a macro to bring
up another macro, and change values in the second, and
save template files automatically as another name. Please
take a look....
ChDir "D:\My Documents\Templates"
Workbooks.Open Filename:= _
"D:\My Documents\Templates\Template Geo
Selector.xls"
Application.Goto Reference:="onetm"
"onetm" is a macro within the file Template Geo
Selector.xls. The word "Template" may be listed as many
as 29 times in this macro.
HERE, I WANT THE REPLACE THE WORD TEMPLATE, WITH A
CATEGORY NAME, AND THEN SAVE THE FILE AS ANOTHER FILE. As
you can see, I have multiple files I want to do this in,
so any help would be appreciated.
ChDir "C:\My Documents"
ActiveWorkbook.SaveAs Filename:= _
"C:\My Documents\Category Geo Selector.xls",
FileFormat _
:=xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=False
ActiveWindow.Close
ChDir "D:\My Documents\Templates"
Workbooks.Open Filename:= _
"D:\My Documents\Templates\Template Time Period
Selector.xls"
Application.Goto Reference:="map12"
AGAIN, I WANT TO ADD SYNTAX TO CHANGE TEMPLATE TO A
CATEGORY NAME.
ChDir "C:\My Documents"
ActiveWorkbook.SaveAs Filename:= _
"C:\My Documents\Category Time Period
Selector.xls", _
FileFormat:=xlNormal, Password:="",
WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWindow.Close
ChDir "D:\My Documents\Templates"
Workbooks.Open Filename:= _
"D:\My Documents\Templates\Template Time Period
Selector2.xls"
Application.Goto Reference:="custmap122"
AGAIN, THE SAME
ChDir "C:\My Documents"
ActiveWorkbook.SaveAs Filename:= _
"C:\My Documents\Category Time Period
Selector2.xls", _
FileFormat:=xlNormal, Password:="",
WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWindow.Close
End Sub