It's unclear exactly what you are trying to do.
The code does not match the formula. There is no reference to J2 in the
formula and no reference to DIRECT in the code. Also, there is no "next" to
go with the "For".
Can you elaborate, then maybe you will get some useful help.
Ian
"teresa" <teresa@discussions.microsoft.com> wrote in message
news:EA173E85-1941-464A-A70D-CBE2BDFA05A1@microsoft.com...
> =IF(AND(B2="Amount",C2<>0),C2,IF(AND(B2="Amount",C2=0,H2<>0),"DIRECT",9))
>
> Hi, Im trying to incorporate the above formula into a macro (below) but am
> having
> some problems with the elses and nesting.
>
> For i = 1 to 100
>
> f Cells(i, 2) = "Amount" Then
> If Cells(i, 3) <> 0 Then
> Cells(i, 10) = Cells(i, 3)
> Else
> Cells(i, 10) = ".5"
>
> End If
> End If
>
> End Sub
>
>
Bookmarks