-
Any quicker?
[VBA]Sub formulation()
Dim FMLA As String
Dim LR As Long
Application.ScreenUpdating = False
LR = Range("B" & Rows.Count).End(xlUp).Row
FMLA = "=IF(RC18="""",0,IF(R33C<RC15,0,IF(R33C>=RC15,IF(0<(RC27),MIN((RC27-SUM(RC[-1]:RC32)),RC28,SUMIF(Shadow_km_Module,RC18,R3C:R32C)-SUMIF(R34C18:R[-1]C18,RC18,R34C)),0))))"
With Range("$AG$35:CH" & LR)
.FormulaR1C1 = FMLA
.Value = .Value
End With
FMLA = "=COUNTIF(RC33:RC86,"">0"")"
With Cells(35, "AD").Resize(LR - 35)
.FormulaR1C1 = FMLA
.Value = .Value
End With
Application.ScreenUpdating = True
End Sub
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules