ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can get values from another cell relative to current? (https://www.excelbanter.com/excel-programming/415940-how-can-get-values-another-cell-relative-current.html)

ExcelMania

How can get values from another cell relative to current?
 
Folks,

Pl help me with this simple issue--

For a range of cells in a worksheet- I need to take values from other cells
on the same worksheet but located at a known relative position.

eg: Value in a cell = value in the cell 4 columns to it's right.
I tried =(COLUMN()-4)ROW()
but got an error. Seems straightforward but how can i do it? I need the
relative position as this has to be done on several parts of the worksheet
and a formula with variables would be easier.

Corey

How can get values from another cell relative to current?
 
use the Offset syntax.
Range("A1").Offset(0,4)

Offset(0,4) = 4 Columns tot he Right
Offset(4,0) = 4 Rows Down
Offset(0,-4)=4 Columns to the Left
Offset(-4,0)=4 Rows Up
Offset(4,4)=4 Rows Down AND 4 Columns to the Right etc ....


Corey....
"ExcelMania" wrote in message
...
Folks,

Pl help me with this simple issue--

For a range of cells in a worksheet- I need to take values from other
cells
on the same worksheet but located at a known relative position.

eg: Value in a cell = value in the cell 4 columns to it's right.
I tried =(COLUMN()-4)ROW()
but got an error. Seems straightforward but how can i do it? I need the
relative position as this has to be done on several parts of the worksheet
and a formula with variables would be easier.




ExcelMania

How can get values from another cell relative to current?
 
Thanks Corey-I will try this out and let you know.

"Corey" wrote:

use the Offset syntax.
Range("A1").Offset(0,4)

Offset(0,4) = 4 Columns tot he Right
Offset(4,0) = 4 Rows Down
Offset(0,-4)=4 Columns to the Left
Offset(-4,0)=4 Rows Up
Offset(4,4)=4 Rows Down AND 4 Columns to the Right etc ....


Corey....
"ExcelMania" wrote in message
...
Folks,

Pl help me with this simple issue--

For a range of cells in a worksheet- I need to take values from other
cells
on the same worksheet but located at a known relative position.

eg: Value in a cell = value in the cell 4 columns to it's right.
I tried =(COLUMN()-4)ROW()
but got an error. Seems straightforward but how can i do it? I need the
relative position as this has to be done on several parts of the worksheet
and a formula with variables would be easier.






All times are GMT +1. The time now is 02:13 AM.

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