Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Arrow right code?

i am recording macros for an excel solution, however, i noticed that when I
arrow right, excel records an absolute reference (ie. Range("B32").Select) of
the row. This is not good because the number of rows will always be
different. How do I make the selection move to the next cell to the right
without absolute reference?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Arrow right code?

activecell.offset(0, 1).select

offsets (moves) the acctive cell 1 column to the right
--
HTH...

Jim Thomlinson


"Amil" wrote:

i am recording macros for an excel solution, however, i noticed that when I
arrow right, excel records an absolute reference (ie. Range("B32").Select) of
the row. This is not good because the number of rows will always be
different. How do I make the selection move to the next cell to the right
without absolute reference?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Arrow right code?

Jim gave you the correct answer, but if you had set your recorder to record
relative, it would have given you this:

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 08/02/2005 by OGILVTW
'

'
ActiveCell.Offset(0, 1).Range("A1").Select
End Sub



The relative/absolute toggle button is the right button the the two button
stop recording toolbar.

As you can see, the Range("A1") part is redundant, but is not incorrect.

--
Regards,
Tom Ogilvy


"Amil" wrote in message
...
i am recording macros for an excel solution, however, i noticed that when

I
arrow right, excel records an absolute reference (ie. Range("B32").Select)

of
the row. This is not good because the number of rows will always be
different. How do I make the selection move to the next cell to the right
without absolute reference?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Arrow right code?

The relative/absolute toggle button is the right button the the two button
stop recording toolbar.

I thought that this button opens the VBA IDE, silly me. Thank you.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Arrow right code?

thanks.

"Jim Thomlinson" wrote:

activecell.offset(0, 1).select

offsets (moves) the acctive cell 1 column to the right
--
HTH...

Jim Thomlinson


"Amil" wrote:

i am recording macros for an excel solution, however, i noticed that when I
arrow right, excel records an absolute reference (ie. Range("B32").Select) of
the row. This is not good because the number of rows will always be
different. How do I make the selection move to the next cell to the right
without absolute reference?

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
Excel 2007 - Macro (VB) code for arrow down & arrow up Grindy Excel Discussion (Misc queries) 5 January 28th 09 04:30 AM
Using end-arrow down or end-arrow up in a macro Richard Champlin Excel Discussion (Misc queries) 2 September 20th 07 01:12 AM
why dont shift+arrow or ctrl+arrow work in 2007 Naguib Excel Discussion (Misc queries) 1 July 24th 07 04:40 PM
How to do the following by pressing the down arrow or up arrow key? cyberdude Excel Discussion (Misc queries) 4 December 14th 05 01:29 PM
Shift and Arrow Key Code strung New Users to Excel 4 October 28th 05 02:07 PM


All times are GMT +1. The time now is 12:43 PM.

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

About Us

"It's about Microsoft Excel"