ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   What Cell am I in? (https://www.excelbanter.com/excel-discussion-misc-queries/217892-what-cell-am-i.html)

BK523

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.



DStrong

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.



BK523

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.



Don Guillett

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.




Don Guillett

What Cell am I in?
 
better

Cells(ActiveCell.Row, Selection(Selection.Count).Column + 2) = "X"

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
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