I run a report during the first week of the month. It captures data monthly, and rolls it to YTD. The file isn't too bad now, but I know at the end of the year, the Excel profiles will be about 500MB+ (which I actually shrunk from 1.2GB)
I have some VBA that takes this file, and lumps a lot of info together... for an easier view to pass out.
I have some efficiency questions with some of my code... I'll post in parts, because the macro is just under 5200 lines! The goal is to make it run a tad quicker, as right now it takes 22-25 minutes per agent, for 95 (and growing) agents...
Here is my first chunk:
It's taking info from one sheet, and combining to fit the new condensed ranges. How's this look?
Thanks
I have some VBA that takes this file, and lumps a lot of info together... for an easier view to pass out.
I have some efficiency questions with some of my code... I'll post in parts, because the macro is just under 5200 lines! The goal is to make it run a tad quicker, as right now it takes 22-25 minutes per agent, for 95 (and growing) agents...
Here is my first chunk:
Code:
Sub OH_PA_In1()
Set NB_Temp = Workbooks("OH New Business - Template.xls")
Set scrap = Workbooks("Macro Scrap.xls")
Dim j As Long
j = 1
Do Until scrap.Sheets(1).Range("C" & j) = "BI Limits"
j = j + 1
Loop
With NB_Temp.Sheets(1)
'BI Limits
.Range("D7:D10").Value = scrap.Sheets(1).Range("D" & j + 1 & ":D" & j + 4).Value
.Range("D11").Value = scrap.Sheets(1).Range("D" & j + 5).Value + scrap.Sheets(1).Range("D" & j + 6).Value + scrap.Sheets(1).Range("D" & j + 7).Value
.Range("D12:D13").Value = scrap.Sheets(1).Range("D" & j + 8 & ":D" & j + 9).Value
.Range("E7:E10").Value = scrap.Sheets(1).Range("F" & j + 1 & ":F" & j + 4).Value
.Range("E11").Value = (scrap.Sheets(1).Range("E" & j + 5) + scrap.Sheets(1).Range("E" & j + 6) + scrap.Sheets(1).Range("E" & j + 7)) / (scrap.Sheets(1).Range("D" & j + 5).Value + scrap.Sheets(1).Range("D" & j + 6).Value + scrap.Sheets(1).Range("D" & j + 7).Value + 0.0001)
.Range("E12:E13").Value = scrap.Sheets(1).Range("F" & j + 8 & ":F" & j + 9).Value
.Range("F7").Resize(7, 1).Formula = "=IF(ISERROR(D7/D$13),0,D7/D$13)"
It's taking info from one sheet, and combining to fit the new condensed ranges. How's this look?
Thanks