Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
BJS
 
Posts: n/a
Default Moving right in a macro

Want to highlight a cell (for example A7), highlight it with a background
colour, move right one cell, highlight it with a background colour, move
right one cell, highlight it - for a total of 15 cells.
If I do this by recording a macro, when I run the macro from cell A15, the
macro highlights A15 then moves to B7 not B15.
How can I accomplish highlighting a continguous range of 15 horizontal cells?
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

All the same color?

If yes, you could get all 15 cells with something like:

ActiveCell.Resize(1, 15).Interior.ColorIndex = 3



BJS wrote:

Want to highlight a cell (for example A7), highlight it with a background
colour, move right one cell, highlight it with a background colour, move
right one cell, highlight it - for a total of 15 cells.
If I do this by recording a macro, when I run the macro from cell A15, the
macro highlights A15 then moves to B7 not B15.
How can I accomplish highlighting a continguous range of 15 horizontal cells?


--

Dave Peterson
  #3   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

BJS,

The macro recorder was not set to relative mode, so it went to the absolute
cell. Record the macro again. In the Stop Recording toolbar (View -
Toolbars), make sure the relative button is lit. You will want to have
selected the starting cell before you start the recorder, or it will record
that move.

Or you could use the existing macro. Move right with

Activecell.offset(0,1).select
--
Earl Kiosterud
www.smokeylake.com

"BJS" wrote in message
...
Want to highlight a cell (for example A7), highlight it with a background
colour, move right one cell, highlight it with a background colour, move
right one cell, highlight it - for a total of 15 cells.
If I do this by recording a macro, when I run the macro from cell A15, the
macro highlights A15 then moves to B7 not B15.
How can I accomplish highlighting a continguous range of 15 horizontal
cells?



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
moving the formula "average" over one column in a macro drumstu Excel Worksheet Functions 1 August 23rd 05 08:01 PM
Macro for moving rows? PeterB New Users to Excel 0 June 7th 05 01:03 PM
Moving down one row in a macro Cathy S. New Users to Excel 3 January 4th 05 09:02 PM
Macro for moving sheets minhao Excel Discussion (Misc queries) 3 December 10th 04 08:09 AM
Moving Down a Cell in Macro Anonymous Excel Discussion (Misc queries) 2 December 5th 04 09:50 AM


All times are GMT +1. The time now is 11:03 AM.

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"