On 2002-03-02 05:16, dk wrote:
Sub Test()
[A1].End(xlToRight)(1, 2).Formula = "=SUM([A1]:[A1].End(xlToRight))"
End Sub
Formula needs a string representing the formula or value you want to place in a cell. You're trying to evaluate something (End(xltoright)) inside of a string - you need something like this:-
[a1].End(xlToRight)(1, 2).Formula = "=sum(A1:" & Range("A1").End(xlToRight).Address & ")"
HTH,
D