Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
moving the formula "average" over one column in a macro | Excel Worksheet Functions | |||
Macro for moving rows? | New Users to Excel | |||
Moving down one row in a macro | New Users to Excel | |||
Macro for moving sheets | Excel Discussion (Misc queries) | |||
Moving Down a Cell in Macro | Excel Discussion (Misc queries) |