Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Whilst there is no error checking and could be cleaned up but this is
what I managed to come up with and is working wonderfully! Except if there is a \ character in the name of the region...... Sub CreateReports() Dim i As Integer Dim CCRange As Range Dim fname As Variant Dim bname As Variant MyPath = "C:\TEMPTRIAL\REPORTS\" ChDir MyPath i = 0 ' inititate loop in range For Each c In Range("loop.range") ' Open budget template workbook Workbooks.Add Template:="C:\TEMPTRIAL\budget worksheet template.XLT" ' return to 2008/09 Master Worksheet Windows("2008-09 Budget Template - trial.xls").Activate Worksheets("BA Report").Range("BCostCentre") = c.Value Calculate bname = "(" & Worksheets("BA Report").Range("BCostCentreDescription").Value & ")" Range("D10:E11").Select Selection.Copy Windows("budget worksheet template1").Activate Range("D10").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Windows("2008-09 Budget Template - trial.xls").Activate Range("G19:H735").Select Selection.Copy Windows("budget worksheet template1").Activate Range("G19").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False ' BCostCentreDescription fname = c.Value & " - " & bname & " - 08.09 BUDGET TEMPLATE" & ".xls" ActiveWorkbook.SaveAs Filename:=fname, CreateBackup:=False ActiveWorkbook.Close Next c End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy and paste up to values in last row | Excel Discussion (Misc queries) | |||
Copy and paste values, formatting and formulas | Excel Discussion (Misc queries) | |||
Copy/Paste how to avoid the copy of formula cells w/o calc values | Excel Discussion (Misc queries) | |||
Copy/Paste Values | Excel Programming | |||
How do i compare values from two sheet and copy & paste if values match? | Excel Programming |