ItalianPlatinum
Well-known Member
- Joined
- Mar 23, 2017
- Messages
- 857
- Office Version
- 365
- 2019
- Platform
- Windows
I have a large file, and i moved the formulas into VBA looking to help the speed but it isn't much improvement. I was able to narrow down the formula to one formula that is taking the most time. Does anyone have any suggestions to help alleviate this? i am up for anything. the file has 400k rows and 18 columns. columns S-AA i set the formulas.
also thanks in advance
VBA Code:
.Range("W5:W" & lr).Formula = "=IF(AND(U5=TRUE,V5=TRUE),I5,WORKDAY(I5,1,HOLIDAYS!A$1:A$65536))"
VBA Code:
'formatting for recon sheet'formatting and formulas for recon sheet
With WsCalc
lr = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("S5:S" & lr).Formula = "=IF(L5>19000000,""Y"",""N"")"
.Range("T5:T" & lr).Formula = "=H5-G5"
.Range("U5:U" & lr).Formula = "=I5=H5"
.Range("V5:V" & lr).Formula = "=I5=J5"
.Range("W5:W" & lr).Formula = "=IF(AND(U5=TRUE,V5=TRUE),I5,WORKDAY(I5,1,HOLIDAYS!A$1:A$65536))"
.Range("X5:X" & lr).Formula = "=IF(WEEKDAY(G5,2)>=5,""Y"",""N"")"
.Range("Y5:Y" & lr).Formula = "=IF(AND(U5=TRUE,V5=TRUE),""Y"",""N"")"
.Range("Z5:Z" & lr).Formula = "=IF(I5<>J5,""Y"",""N"")"
.Range("AA5:AA" & lr).Formula = "=IF(AND(S5=""N"",T5>0,X5=""N""),""Y"",""N"")"
.Range("S5:AA" & lr).Value = .Range("S5:AA" & lr).Value
.Columns("A:AA").EntireColumn.AutoFit
'.Range("2:2").AutoFilter 20, "Yes"
.Application.Goto Reference:=.Range("A1"), Scroll:=True
.Activate
End With
also thanks in advance