Naveed i'm hoping you can help me amend your original code relating to an update made in the the "Financials" tab.
I've included my actual amended code below and a new attachment with the "Financials" tab amended. The data from the master file needs to be exported into the template horizontally rather than vertically (per my first attached template). The "RAG" import works perfectly
Sub Monthly_report_export()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
PR = ActiveWorkbook.Name
Dim sh As Worksheet
Dim LR As Long
Dim FR As Long
FPath = "D:\Documents and Settings\uczbmon\Desktop\New Folder (2)"
Set sh = Workbooks("" & PR & "").Sheets("Project Register")
With sh
LR = .Range("L" & .Rows.Count).End(xlUp).Row
RAG = Array("M", "L", "F", "T", "AF", "AG", "U", "V", "AC", "Z", "AA", "P", "BO", "BQ", "BR", "BT", "BV", "BX", "BZ", "CB", "CD")
For j = 2 To LR
Workbooks.Open FPath & "\" & "Monthly Report Template.xlsx"
MPR = ActiveWorkbook.Name
FR = 2 'Workbooks("" & mybk & "").Sheets("RAG").Range("B" & Rows.Count).End(xlUp).Row
'Workbooks("" & mymc & "").Sheets("Sheet1").Activate
For i = LBound(RAG, 1) To UBound(RAG, 1)
.Range(RAG(i) & j).Copy Workbooks("" & MPR & "").Sheets("RAG Status").Range("B" & FR)
FR = FR + 1
Next
'Workbooks("" & mybk & "").Sheets("RAG").Range("A9").EntireRow.Insert shift:=xlDown
FR = 2
FIN = Array("BL", "BM", "BN", "BD", "BG")
For k = LBound(FIN, 1) To UBound(FIN, 1)
.Range(FIN(k) & j).Copy Workbooks("" & MPR & "").Sheets("Financials").Range("B" & FR)
FR = FR + 1
Next
ActiveWorkbook.SaveAs FileName:=FPath & "\" & .Range("L" & j) & "_" & .Range("M" & j) & ".xls", FileFormat:=xlExcel8
ActiveWorkbook.Close False
Next
End With
MsgBox "Done ! " & "File Saved Here - " & FPath, vbInformation
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
Bookmarks