ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macros - stepping left in a macro (https://www.excelbanter.com/excel-programming/278805-macros-stepping-left-macro.html)

Rich H.

Macros - stepping left in a macro
 
Unlike what I remember of Lotus or Quattro macros, when I
record in Excel a keyboard move to the left (or right)
picks up the cell number, not the number of steps. I
need to go to a named point, insert a column, move left
twice, then fill a date one step to the right (basically
to add a new date column). By doing this I hope to
expand the range for sorting and printing purposes. But
nothing seems to work as I expect.
How do I use named ranges in macro?
How do I go to a point and step in any direction?
How do I fill a date one cell to the right?

Don Guillett[_4_]

Macros - stepping left in a macro
 
Have a look in help for OFFSET

"Rich H." wrote in message
...
Unlike what I remember of Lotus or Quattro macros, when I
record in Excel a keyboard move to the left (or right)
picks up the cell number, not the number of steps. I
need to go to a named point, insert a column, move left
twice, then fill a date one step to the right (basically
to add a new date column). By doing this I hope to
expand the range for sorting and printing purposes. But
nothing seems to work as I expect.
How do I use named ranges in macro?
How do I go to a point and step in any direction?
How do I fill a date one cell to the right?




Chip Pearson

Macros - stepping left in a macro
 
Rich,

Try something like the following:

Range("TheName").Select ' go to 'TheName'
Selection.Offset(0,-2).Select ' move two cells left

See Offset in VBA Help for more details.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com


"Rich H." wrote in message
...
Unlike what I remember of Lotus or Quattro macros, when I
record in Excel a keyboard move to the left (or right)
picks up the cell number, not the number of steps. I
need to go to a named point, insert a column, move left
twice, then fill a date one step to the right (basically
to add a new date column). By doing this I hope to
expand the range for sorting and printing purposes. But
nothing seems to work as I expect.
How do I use named ranges in macro?
How do I go to a point and step in any direction?
How do I fill a date one cell to the right?





All times are GMT +1. The time now is 03:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com