Thread: macro problems
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
toolpusher toolpusher is offline
external usenet poster
 
Posts: 1
Default macro problems


Hi Trying to write a macro but I am hopeless. I have a list of
increasing values in column a in column b I am trying to put in the
difference in value compared with the first cell so far I have this.

' Keyboard Shortcut: Ctrl+w
'
ActiveCell.FormulaR1C1 = "=SUM(RC[-1]-R[-1]C[-1])"

With Selection.Interior
..ColorIndex = 3
..Pattern = xlSolid
End With
Selection.Offset(1, 0).Select ' move down

If I could get the -1 in the -R[-1] part of the formula to increase by
1 every time the cursor went down a cell this would be great until i
came to the next list of increasing values where it would need to start
at -1 again.

Any help with this would be great

regards

John


--
toolpusher
------------------------------------------------------------------------
toolpusher's Profile: http://www.excelforum.com/member.php...o&userid=19062
View this thread: http://www.excelforum.com/showthread...hreadid=346083