Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
delete rows w/o hardcoding numbers Dave B[_9_] Excel Programming 3 November 18th 05 07:40 PM
Selecting worksheets without hardcoding Bob Phillips[_6_] Excel Programming 1 May 4th 04 09:01 PM
Selecting worksheets without hardcoding jeff Excel Programming 0 May 4th 04 08:45 PM
How to open workbook from template without hardcoding Michael Turner Excel Programming 2 November 20th 03 10:29 PM
how to open workbook without hardcoding path Michael Turner Excel Programming 3 November 20th 03 12:12 PM


All times are GMT +1. The time now is 04:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"