macro problems

  • Thread starter Thread starter toolpusher
  • Start date Start date
T

toolpusher

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
 
Col A Col B
1 0 forumula =A1-$A1
2 1 = A2-$A1
3 2 =A3-$A1
15 14 =A4-$A1

Is that what you want?

Glen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top