ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Offset from a variable column to a fixed column (https://www.excelbanter.com/excel-programming/365532-offset-variable-column-fixed-column.html)

Kurt Barr

Offset from a variable column to a fixed column
 
I'm trying to put together a macro that will take a value from one cell in a
row, and then move it to another cell in the same row. The originating cell
is going to vary, but the receiving cell is going to be in a constant column
in the same row. I know about using offset to move over a specified number of
cells, but I'm not certain as to how many cells I'm going to want to move
over to get to the same column in each row that I work with. Is there a way
to use offset to move into a constant column?

Ardus Petus

Offset from a variable column to a fixed column
 
set rCell=Cells(Activecell.row,"B")

will set rCell to same row as active cell, column B

HTH
--
AP

"Kurt Barr" a écrit dans le message de
news: ...
I'm trying to put together a macro that will take a value from one cell in
a
row, and then move it to another cell in the same row. The originating
cell
is going to vary, but the receiving cell is going to be in a constant
column
in the same row. I know about using offset to move over a specified number
of
cells, but I'm not certain as to how many cells I'm going to want to move
over to get to the same column in each row that I work with. Is there a
way
to use offset to move into a constant column?




Kurt Barr

Offset from a variable column to a fixed column
 
Perfect!! That was just what I needed. Thanks!!

"Ardus Petus" wrote:

set rCell=Cells(Activecell.row,"B")

will set rCell to same row as active cell, column B

HTH
--
AP

"Kurt Barr" a écrit dans le message de
news: ...
I'm trying to put together a macro that will take a value from one cell in
a
row, and then move it to another cell in the same row. The originating
cell
is going to vary, but the receiving cell is going to be in a constant
column
in the same row. I know about using offset to move over a specified number
of
cells, but I'm not certain as to how many cells I'm going to want to move
over to get to the same column in each row that I work with. Is there a
way
to use offset to move into a constant column?






All times are GMT +1. The time now is 01:14 AM.

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