LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Running a macro across a folder

OK, so here's the problem, I have a macro below which runs on a specific file
and re-saves it as long as I specify both filenames. I need to be able to
run this action across multiple reports (up to 200 per month) and the file
names will be inconsistent. Is there anyway I can run this macro across all
sheets in a specified folder?

Thanks guys
Anne





Sub Orchardcopypaste()

ChDir "C:\ORCHARD"
Workbooks.Open Filename:="C:\ORCHARD\CalendarView - February -
Eureka[1].xls"
Rows("1:3").Select
Selection.Clear
ActiveSheet.Shapes("Picture 75").Select
Selection.Delete

Range("A1").Select
Sheets.Add
Sheets("Report").Select
ActiveSheet.Pictures.Insert("C:\ORCHARD\orchard header.jpg").Select

Range("AW2").Select
ActiveCell.FormulaR1C1 = "Monthly Management Report"
Range("U4:BB11").Select
Selection.Copy
Range("AW2").Select
With Selection.Font
.Name = "Arial"
.Size = 26
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Selection.Font.Bold = True
Selection.Cut Destination:=Range("AV2")
Range("AV2").Select
ActiveWorkbook.SaveAs Filename:="C:\ORCHARD\Orchard complete2.xls", _
FileFormat:=xlExcel9795, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
ActiveWorkbook.Close
End Sub
 
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
Report with macro losing links to a particular worksheet after running macro santhu Excel Programming 0 March 1st 07 03:25 AM
disable user running macro from Tools Macro Steve Simons Excel Discussion (Misc queries) 4 September 28th 06 06:28 AM
Save file in a new folder, but create folder only if folder doesn't already exist? nbaj2k[_40_] Excel Programming 6 August 11th 06 08:41 PM
Need syntax for RUNning a Word macro with an argument, called from an Excel macro Steve[_84_] Excel Programming 3 July 6th 06 07:42 PM
Launch Macro in Access via Macro running in Excel??? dgrant Excel Programming 1 September 24th 03 01:38 PM


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