View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
merjet merjet is offline
external usenet poster
 
Posts: 812
Default Rew Macro For Computation

I changed the column references. The Sub is now:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 4 Or Target.Column = 5 Or Target.Column = 6 Or
Target.Column = 8 Then
If Range("D" & Target.Row) < "" And Range("E" & Target.Row)
< "" And Range("F" & Target.Row) < "" And Range("H" & Target.Row) <
"" Then
Range("K" & Target.Row).FormulaR1C1 =
"=IF(ISBLANK(R8C4)=FALSE,RC[-7]*RC[-6]*RC[-5]/144*RC[-3])"
End If
End If
End Sub

R8C4 refers to row 8, column 4, i.e. D8. RC[-7] refers to the cell in
the same row and 7 columns left of column K. Similar for the others.

Hth,
Merjet