View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ram Ram is offline
external usenet poster
 
Posts: 138
Default using VB to enter a sumproduct formula in a cell

I would like help with the following syntax error:

Private Sub worksheet_Activate()
If Not ActiveSheet.Previous Is Nothing Then
Me.Range("B2").Formula =
"=SumProduct(--(Sheets("Sheet4").Range(A1:A30000) = Sheets(Processd
Amount).Range(B1)),--(Sheets(Sheet4).Range(AL1:AL30000) 0))"
End If
End Sub

also is there a way to enter the value of the above formula instead of the
formula?

Thanks for all your help