dwg83
Board Regular
- Joined
- Nov 8, 2006
- Messages
- 174
This code is running extremely slow. Is there a better way to do this so it won't be agonizingly slow.
Thanks!
Thanks!
Code:
'adds formulae to rows that have data
If Target.Column = 1 Then
For Each i In Target.Rows
If Cells(i.Row, 1) <> "" Then
Cells(i.Row, 16) = "=IF(ISERROR(Q" & i.Row & "/R" & i.Row & "),"""",Q" & i.Row & "/R" & i.Row & ")"
Cells(i.Row, 17) = "=IF(AND((B" & i.Row & "-C" & i.Row & ")>0,R" & i.Row & ">3),B" & i.Row & "-C" & i.Row & ",0)"
Cells(i.Row, 18) = "=IF((B" & i.Row & "-M" & i.Row & ")>3,B" & i.Row & "-M" & i.Row & ",0)"
Else
Cells(i.Row, 16) = ""
Cells(i.Row, 17) = ""
Cells(i.Row, 18) = ""
End If
Next
End If