![]() |
What Cell am I in?
I would like to write a macro that will move x number of cells to the right
from whatever cell (or range) my cursor is currently in. Example: if I highlight a range of A20:E20, i would like the macro to move 2 cells to the right (in this case to G20) and type "X". if I highlight a range of A15:E15, I would like the macro to move 2 cells to the right (in this case to G15). Thanks (in advance) for your help -- this site is a big help to me. |
What Cell am I in?
Try this out:
activecell.offset(o,2).select activecell.value="x" Is this what you are looking to do? -- David =Sub Let_me_ macronize_that_for_you!() msgbox("Poof, it''''s done.") End Sub "BK523" wrote: I would like to write a macro that will move x number of cells to the right from whatever cell (or range) my cursor is currently in. Example: if I highlight a range of A20:E20, i would like the macro to move 2 cells to the right (in this case to G20) and type "X". if I highlight a range of A15:E15, I would like the macro to move 2 cells to the right (in this case to G15). Thanks (in advance) for your help -- this site is a big help to me. |
What Cell am I in?
EXCELLENT! - That is JUST what I wanted to do.
Thanks again. "DStrong" wrote: Try this out: activecell.offset(o,2).select activecell.value="x" Is this what you are looking to do? -- David =Sub Let_me_ macronize_that_for_you!() msgbox("Poof, it''''s done.") End Sub "BK523" wrote: I would like to write a macro that will move x number of cells to the right from whatever cell (or range) my cursor is currently in. Example: if I highlight a range of A20:E20, i would like the macro to move 2 cells to the right (in this case to G20) and type "X". if I highlight a range of A15:E15, I would like the macro to move 2 cells to the right (in this case to G15). Thanks (in advance) for your help -- this site is a big help to me. |
What Cell am I in?
Will this do?
Selection.End(xlToRight).Offset(, 2).value="X" 'Select -- Don Guillett Microsoft MVP Excel SalesAid Software "BK523" wrote in message ... I would like to write a macro that will move x number of cells to the right from whatever cell (or range) my cursor is currently in. Example: if I highlight a range of A20:E20, i would like the macro to move 2 cells to the right (in this case to G20) and type "X". if I highlight a range of A15:E15, I would like the macro to move 2 cells to the right (in this case to G15). Thanks (in advance) for your help -- this site is a big help to me. |
All times are GMT +1. The time now is 04:43 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com