ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macros (https://www.excelbanter.com/excel-discussion-misc-queries/235944-macros.html)

Rachel

Macros
 
I am having a problem when recording macros. In order for the stop recording
button to become active I must hit enter or otherwise get out of the cell I
recorded the macro in. Therefore, when I go elsewhere in the sheet and play
the macro, at the end it always takes my cursor to the cell where I ended
when recording. What I want to accomplish is having the cursor advance to
the cell to the right of the one I've played the macro in each time, not
returning to the same static cell regardless of where I played the macro.
Anyone know what I'm doing wrong? Please advise. Thank you.
--
Rachel

Luke M

Macros
 
Open up your VB editor (Alt+F11), and using the project window (top left
usually) find the module that contains your macro that you recorded. Near the
end, you'll probably see something like

Range("F6").Select

right after performing the actual operation you want accomplished. To select
the cell one to the right of wherever you are currently, replace that line
with this one:

activecell.Offset(0,1).Select
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Rachel" wrote:

I am having a problem when recording macros. In order for the stop recording
button to become active I must hit enter or otherwise get out of the cell I
recorded the macro in. Therefore, when I go elsewhere in the sheet and play
the macro, at the end it always takes my cursor to the cell where I ended
when recording. What I want to accomplish is having the cursor advance to
the cell to the right of the one I've played the macro in each time, not
returning to the same static cell regardless of where I played the macro.
Anyone know what I'm doing wrong? Please advise. Thank you.
--
Rachel


Rachel

Macros
 
That worked. Thank you.
--
Rachel


"Luke M" wrote:

Open up your VB editor (Alt+F11), and using the project window (top left
usually) find the module that contains your macro that you recorded. Near the
end, you'll probably see something like

Range("F6").Select

right after performing the actual operation you want accomplished. To select
the cell one to the right of wherever you are currently, replace that line
with this one:

activecell.Offset(0,1).Select
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Rachel" wrote:

I am having a problem when recording macros. In order for the stop recording
button to become active I must hit enter or otherwise get out of the cell I
recorded the macro in. Therefore, when I go elsewhere in the sheet and play
the macro, at the end it always takes my cursor to the cell where I ended
when recording. What I want to accomplish is having the cursor advance to
the cell to the right of the one I've played the macro in each time, not
returning to the same static cell regardless of where I played the macro.
Anyone know what I'm doing wrong? Please advise. Thank you.
--
Rachel



All times are GMT +1. The time now is 02:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com