Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 97 - arrowing in a macro

Status
Not open for further replies.

akbryer

Programmer
Mar 25, 1999
110
US
I'm trying to create a keystroke macro, which includes arrowing left or right or up or down. It seems that when I arrow in any direction the macro retains the line number of from the first time I arrow. When I run the macro subsequent to the first running, my cursor ends up at the line that is hardcoded from when I created the macro. <br>
<br>
Ideas? <p>Gary (akbryer)<br><a href=mailto:Gary_Bryer@Vanguard.com>Gary_Bryer@Vanguard.com</a><br><a href= > </a><br> <br>
<br>
Good deeds do not go unrewarded!
 
You can record macros that use the Offset property instead of absolute references. On the Tools menu, point to Record Macro, and then click Use Relative References.<br>
<br>
(Boy that sounds good, but I copied it right from Excel 2000 VBA help files. If the option isn't right there in '97, I know that it IS there somewhere.)<br>
<br>
Good luck.
 
A bit late (this is October, and you posted in January)

I use
ActiveCell.Offset(-1, 1).Select
to pick a relative cell. What this picks is one cell up (-1) and one cell right (1)
-- mike [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top