Discussion:
ActiveCell.Offset for event macro
(too old to reply)
Jeremy
2010-01-12 04:06:02 UTC
Permalink
I need to move from the active cell in any row to the cell in column 6 of
the same row.
I know how to use ActiveCell.Offset to move a fixed number of rows and
columns. But I can't figure out how to handle a relative row and absolute
column situtation.
What I need is... ActiveCell.Offset(0,"however many cells there are between
the column I'm in and column 6)
Do I need to create a variable to calculate the number of cells, or is there
a simpler way?
Thank you!
joe1946
2010-01-12 04:55:32 UTC
Permalink
ActiveCell.Offset(0,6 - ActiveCell.Column)

---
frmsrcurl: http://msgroups.net/microsoft.public.excel.programming/ActiveCell.Offset-for-event-macro
joe1946
2010-01-12 04:59:56 UTC
Permalink
ActiveCell.Offset(0,6 - ActiveCell.Column)

---
frmsrcurl: http://msgroups.net/microsoft.public.excel.programming/ActiveCell.Offset-for-event-macro
Dave Peterson
2010-01-12 13:45:32 UTC
Permalink
activesheet.cells(activecell.row,6).select

is another way.
Post by Jeremy
I need to move from the active cell in any row to the cell in column 6 of
the same row.
I know how to use ActiveCell.Offset to move a fixed number of rows and
columns. But I can't figure out how to handle a relative row and absolute
column situtation.
What I need is... ActiveCell.Offset(0,"however many cells there are between
the column I'm in and column 6)
Do I need to create a variable to calculate the number of cells, or is there
a simpler way?
Thank you!
--
Dave Peterson
Loading...