Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Modifing a recorded macro.

I would like to use this macro on 8-10 workbooks.

Range("B3:P357").Select
Selection.Copy
ChDir "M:\"
Workbooks.Open Filename:="M:\Expired Template.xlt", Editable:=True
Range("E4").Select
ActiveSheet.Paste
Range("B4").Select
Application.CutCopyMode = False
ChDir "M:\North"
Range("F4").Select
ActiveCell.FormulaR1C1 = "ALLYN"
ActiveWorkbook.SaveAs Filename:="M:\North\ALLYN.xls", FileFormat:=xlNormal _
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
End Sub

I want to save the workbooks using the name in cell f4. the recorded macro
has hard coded the name in first workbook uses it to name the other workbooks
Thanks for the help in advance

--
Duane Reynolds
XP Associate Expert
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Modifing a recorded macro.

"Duane Reynolds" ha scritto nel
messaggio ...
I would like to use this macro on 8-10 workbooks.

Range("B3:P357").Select
Selection.Copy
ChDir "M:\"
Workbooks.Open Filename:="M:\Expired Template.xlt", Editable:=True
Range("E4").Select
ActiveSheet.Paste
Range("B4").Select
Application.CutCopyMode = False
ChDir "M:\North"
Range("F4").Select
ActiveCell.FormulaR1C1 = "ALLYN"
ActiveWorkbook.SaveAs Filename:="M:\North\ALLYN.xls", FileFormat:=xlNormal
_
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
End Sub

I want to save the workbooks using the name in cell f4. the recorded macro
has hard coded the name in first workbook uses it to name the other
workbooks
Thanks for the help in advance


Hi Duane,
try with this:

Sub Test()
Dim filen As String

Range("B3:P357").Copy
Workbooks.Open Filename:="M:\Expired Template.xlt", Editable:=True
Range("E4").Select
ActiveSheet.Paste
Application.CutCopyMode = False
filen = "M:\North\" & Range("F4").Value & ".xls"
ActiveCell.FormulaR1C1 = "ALLYN"
ActiveWorkbook.SaveAs filen, FileFormat:=xlNormal _
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
End Sub



--
Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy


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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
How to FIX Recorded Macro JMay Excel Discussion (Misc queries) 7 May 23rd 07 04:13 AM
Creating a macro which presses a button containing a recorded macro petros89[_3_] Excel Programming 3 October 5th 05 02:49 PM
Recorded macro won't run Jim Thomlinson[_4_] Excel Programming 0 June 14th 05 01:23 AM
Recorded macro won't run rjamison Excel Programming 0 June 14th 05 12:14 AM


All times are GMT +1. The time now is 12:23 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"