Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Danny
 
Posts: n/a
Default ADD Macro - xlup plus xlto right

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,
  #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,



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jim Thomlinson
 
Posts: n/a
Default ADD Macro - xlup plus xlto right

Try adding this line of code where you want to go up and to the right...

MsgBox ActiveCell.End(xlUp).End(xlToRight)

It will display the value you are looking for without moving the cursor...
--
HTH...

Jim Thomlinson


"Danny" wrote:

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,

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Danny
 
Posts: n/a
Default ADD Macro - xlup plus xlto right

Thank you for your response.

All I need is, in a cell, how would I add the figures up using xlup then add
xl to right. Say If the active cell is in a10, how can I add +a4+d4 using
xlup and xlToRight

Can I please have a macro without the message box?

Thanks Again

"Jim Thomlinson" wrote:

Try adding this line of code where you want to go up and to the right...

MsgBox ActiveCell.End(xlUp).End(xlToRight)

It will display the value you are looking for without moving the cursor...
--
HTH...

Jim Thomlinson


"Danny" wrote:

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,

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jim Thomlinson
 
Posts: n/a
Default ADD Macro - xlup plus xlto right

with Range("A10")
.value = .end(xlup).value + .end(xlup).end(xlToRight).value
end with
--
HTH...

Jim Thomlinson


"Danny" wrote:

Thank you for your response.

All I need is, in a cell, how would I add the figures up using xlup then add
xl to right. Say If the active cell is in a10, how can I add +a4+d4 using
xlup and xlToRight

Can I please have a macro without the message box?

Thanks Again

"Jim Thomlinson" wrote:

Try adding this line of code where you want to go up and to the right...

MsgBox ActiveCell.End(xlUp).End(xlToRight)

It will display the value you are looking for without moving the cursor...
--
HTH...

Jim Thomlinson


"Danny" wrote:

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,



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Danny
 
Posts: n/a
Default ADD Macro - xlup plus xlto right

Perfect! Thanks a lot!

"Jim Thomlinson" wrote:

with Range("A10")
.value = .end(xlup).value + .end(xlup).end(xlToRight).value
end with
--
HTH...

Jim Thomlinson


"Danny" wrote:

Thank you for your response.

All I need is, in a cell, how would I add the figures up using xlup then add
xl to right. Say If the active cell is in a10, how can I add +a4+d4 using
xlup and xlToRight

Can I please have a macro without the message box?

Thanks Again

"Jim Thomlinson" wrote:

Try adding this line of code where you want to go up and to the right...

MsgBox ActiveCell.End(xlUp).End(xlToRight)

It will display the value you are looking for without moving the cursor...
--
HTH...

Jim Thomlinson


"Danny" wrote:

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,

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
macro with F9 Kenny Excel Discussion (Misc queries) 1 August 3rd 05 02:41 PM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


All times are GMT +1. The time now is 05:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"