ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro hardcoding issue (https://www.excelbanter.com/excel-programming/366619-macro-hardcoding-issue.html)

cooldyood[_4_]

Macro hardcoding issue
 

hi all,

I keep hitting this problem and I'm sure there's a way to resolve
this.

When recording macros, I always use the Ctrl+arrow combinations to
navigate across cells. But when I look at the code, there are always
hardcoded cell numbers. Is there a list of functions I can use for
Ctrl+arrow (or just the arrow) programatically?

Thanks a lot!


--
cooldyood
------------------------------------------------------------------------
cooldyood's Profile: http://www.excelforum.com/member.php...o&userid=35611
View this thread: http://www.excelforum.com/showthread...hreadid=559466


Bob Phillips

Macro hardcoding issue
 


ActiveCell.End(xlDown/XlUp/xlToRight/xlToLeft).Select



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"cooldyood" wrote
in message ...

hi all,

I keep hitting this problem and I'm sure there's a way to resolve
this.

When recording macros, I always use the Ctrl+arrow combinations to
navigate across cells. But when I look at the code, there are always
hardcoded cell numbers. Is there a list of functions I can use for
Ctrl+arrow (or just the arrow) programatically?

Thanks a lot!


--
cooldyood
------------------------------------------------------------------------
cooldyood's Profile:

http://www.excelforum.com/member.php...o&userid=35611
View this thread: http://www.excelforum.com/showthread...hreadid=559466




HeyNow100

Macro hardcoding issue
 
cooldyood wrote:

When recording macros, I always use the Ctrl+arrow combinations to
navigate across cells. But when I look at the code, there are always
hardcoded cell numbers. Is there a list of functions I can use for
Ctrl+arrow (or just the arrow) programatically?



When you record a macro the box that appears that lets you stop
recording also has another button next to it (the one on the right).
This button is a relative reference button. If you want all your
actions hardcoded then leave it alone. But if you want to record
Cntrl+arrow combinations to move around the cells, you should click the
relative referrence button.

You can click it more than once, to toggle between relative and
absolute references within the same macro.


Alex van der Spek

Macro hardcoding issue
 
On Fri, 07 Jul 2006 13:52:33 -0500, cooldyood wrote:


hi all,

I keep hitting this problem and I'm sure there's a way to resolve
this.

When recording macros, I always use the Ctrl+arrow combinations to
navigate across cells. But when I look at the code, there are always
hardcoded cell numbers. Is there a list of functions I can use for
Ctrl+arrow (or just the arrow) programatically?

Thanks a lot!


Use the .End method. Like this:

<
....
activecell.end(xlDown)
....


There also exist constants xlUp, xlToLeft and xlToRight.

Good luck.


cooldyood[_5_]

Macro hardcoding issue
 

I can't find the "relative reference button" in the top menu. Is there
macro toolbar too? I can't find it at all, not sure if the "relativ
reference button" is in the toolbar.

HeyNow100 Wrote:
cooldyood wrote:

When recording macros, I always use the Ctrl+arrow combinations to
navigate across cells. But when I look at the code, there are always
hardcoded cell numbers. Is there a list of functions I can use for
Ctrl+arrow (or just the arrow) programatically?



When you record a macro the box that appears that lets you stop
recording also has another button next to it (the one on the right).
This button is a relative reference button. If you want all your
actions hardcoded then leave it alone. But if you want to record
Cntrl+arrow combinations to move around the cells, you should clic
the
relative referrence button.

You can click it more than once, to toggle between relative and
absolute references within the same macro


--
cooldyoo
-----------------------------------------------------------------------
cooldyood's Profile: http://www.excelforum.com/member.php...fo&userid=3561
View this thread: http://www.excelforum.com/showthread.php?threadid=55946



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

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