makeitwork09
Technical User
I am using Excel 2007.
Is there a way to modify this code so that a loop is not required? Would I need to use an array? My goal is to make the code faster.
I attempted to do this, but it, of course, does not work
Thanks
Is there a way to modify this code so that a loop is not required? Would I need to use an array? My goal is to make the code faster.
Code:
For Each FUIntPayoffCellRng In Range(Range("AG2"), Range("AG2").End(xlDown))
If FUIntPayoffCellRng.Value <> 0 Then
Cells(FUIntPayoffCellRng.Row, "I").Value = FUIntPayoffCellRng.Value
Else
Cells(FUIntPayoffCellRng.Row, "I").Value = Cells (FUIntPayoffCellRng.Row, "I").Value
End If
Next FUIntPayoffCellRng
I attempted to do this, but it, of course, does not work
Code:
If Range("AG2:AG" & FULastRow).Value <> 0 Then
Range("I2:I" & FULastRow).Value = Range("AG2:AG" & FULastRow).Value
Else
Range("I2:I" & FULastRow).Value = Range("I2:I" & FULastRow).Value
End If
Thanks