Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
macro with F9 | Excel Discussion (Misc queries) | |||
Make Alignment options under format cells available as shortcut | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) |