Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://excel-egy.com/forum/t3954
- ---------------------------------
- Sub Convert_Formulas_To_VBA_Code()
- Dim lr As Long
- Application.ScreenUpdating = False
- With ActiveSheet
- .Range("A6").Formula = "=IF(C6+D6>0,C6,0)"
- .Range("A6").Offset(, 1).Formula = "=IF(C6+D6<0,D6,0)"
- lr = .Cells(Rows.Count, "H").End(xlUp).Row
- .Range("A7:A" & lr).Formula = "=IF(G7<>"""",IF(C7+D7+A6+B6>0,C7+D7+A6+B6,0),0)"
- .Range("B7:B" & lr).Formula = "=IF(G7<>"""",IF(C7+D7+A6+B6<0,C7+D7+A6+B6,0),0)"
- .Range("A6:B" & lr).Value = .Range("A6:B" & lr).Value
- End With
- Application.ScreenUpdating = True
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement