Good morning,
My manager has tasked me with building a reporting automation piece for our biggest client. Every month, they want to have an updated units and volume count for the various loan programs they offer. 1 report will be run out of our originations system and the values from that report will need to be placed on a year to date master report that contains columns for every month and a running total. I've already built this master report template, but I'm running into difficulties setting up the code that will read the monthly originations report. It appears that I will need to use nested loop statements to make this work, and since I've only used single loop statements, I suspect my syntax is off. The code is below for just one loan program. Once I figure out the correct syntax, I can replicate for all loan programs involved. The Tname spreadsheet is the originations report and ThisWorkbook is template that the data needs to be copied into. I'm trying to use active cell properties on each spreadsheet and perhaps that won't work? I'm not sure. Any assistance will be appreciated!
Sub PopulateSingleMonthData()
ThisWorkbook.Activate
fund = Range("FundedReportFilePath")
copyaddress = fund
Workbooks.Open Filename:=(copyaddress)
Tname = ActiveWorkbook.Name
Windows(Tname).Activate
Sheets("Table").Select
Range("C2").Activate
ThisWorkbook.Activate
Sheets("Report").Activate
Range("B14").Activate
Windows(Tname).Activate
Do Until ActiveCell = "" And ActiveCell.Offset(1, 0) = ""
If ActiveCell.Offset(-1, 0).Value = "10 YEAR FIXED SUMMARY" Then
Do Until ActiveCell = "" And ActiveCell.Offset(1, 0) = ""
If ActiveCell.Offset(-3, 0).Value = "10 Year - Fixed" Then
Windows(Tname).ActivateCell = ThisWorkbook.ActivateCell
ActiveCell.Offset(1, 0).Activate
Else
ActiveCell.Offset(1, 0).Activate
End If
Loop
Else
Offset(-1, 0).Activate
End If
Loop
End Sub
Bookmarks