View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Trevor Shuttleworth
 
Posts: n/a
Default ADD Macro - xlup plus xlto right

Not quite sure what you want to do but here are some examples:

This one goes up to the bottom non-blank row in column B and adds that to
the value in column C

MsgBox Range("B65536").End(xlUp).Value + _
Range("B65536").End(xlUp).Offset(0, 1).Value

This adds the value in the cell above to the cell next to that

MsgBox ActiveCell.Offset(-1, 0).Value + _
ActiveCell.Offset(-1, 1).Value

Hope this helps

Regards

Trevor


"Danny" wrote in message
...
Hi,

I tried to record macro step by step but the macro will not write it for
me.

How can I write a macro for: + xlup + xlto right
I just want to add two numbers but using xlup and xltotheright.

Thank you,