View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Updating the formula by program

On the off hand chance you might want to press the button more than once,
this might be a possibility:

Sub AddNextRow()
Dim rng As Range, rng1 As Range
Dim rng2 As Range
Set rng = Range("B9")
On Error GoTo ErrHandler
Set rng1 = rng.DirectPrecedents
Set rng2 = rng1.Areas(rng1.Areas.Count)
Set rng2 = rng2(rng2.Count)(2)
rng.Formula = rng.Formula & "+" & rng2.Address(0, 0)
ErrHandler:
End Sub


--
Regards,
Tom Ogilvy

"sameerce " wrote in message
...
No Frank, the formula you suggested is not working.

Any other suggestions?


---
Message posted from http://www.ExcelForum.com/