ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   subtracting column from column (https://www.excelbanter.com/excel-programming/398818-subtracting-column-column.html)

Rick S.

subtracting column from column
 
I am trying to get the value from one cell while in another. If I am at "C6"
(I have this in a variable) I need to know how to get the value from "A6".
How do I do this?

--
Regards

Rick
XP Pro
Office 2007


Rick S.

subtracting column from column
 
The cell I get information from will always be different, reading cell.value
from column "A" dependant on cell.address (row) of any other cell.

--
Regards

Rick
XP Pro
Office 2007



"Rick S." wrote:

I am trying to get the value from one cell while in another. If I am at "C6"
(I have this in a variable) I need to know how to get the value from "A6".
How do I do this?

--
Regards

Rick
XP Pro
Office 2007


Don Guillett

subtracting column from column
 
msgbox cells(activecell.row,1)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Rick S." wrote in message
...
The cell I get information from will always be different, reading
cell.value
from column "A" dependant on cell.address (row) of any other cell.

--
Regards

Rick
XP Pro
Office 2007



"Rick S." wrote:

I am trying to get the value from one cell while in another. If I am at
"C6"
(I have this in a variable) I need to know how to get the value from
"A6".
How do I do this?

--
Regards

Rick
XP Pro
Office 2007



JLGWhiz

subtracting column from column
 
there's a couple of ways. If you want C6 to equal A6 value then:
Cells(6, 3) = Cells(6, 1) Or Cells(6, 3) = Cells(6, 3).Offset(0, -2)
If you just want to capture the value then use a variable:
myVar = Cells(6, 1).Value

Those are all VB code. If you are in Excel and using formulas then
in Cell C6 you put: = A6

You can use the Offset method to move around the sheet while using a
variable value like: For i = 1 To Rows.Count
For x = 1 To Columns.Count
Cells(6, 3) = Cells(i, x)
Next x
Next i


Since the answer is that simple, I must not be answering your real question,
Right?
"Rick S." wrote:

I am trying to get the value from one cell while in another. If I am at "C6"
(I have this in a variable) I need to know how to get the value from "A6".
How do I do this?

--
Regards

Rick
XP Pro
Office 2007


Don Guillett

subtracting column from column
 
or

cells(activecell.row,activecell.column)=cells(acti vecell.row,1)


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message
...
msgbox cells(activecell.row,1)

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Rick S." wrote in message
...
The cell I get information from will always be different, reading
cell.value
from column "A" dependant on cell.address (row) of any other cell.

--
Regards

Rick
XP Pro
Office 2007



"Rick S." wrote:

I am trying to get the value from one cell while in another. If I am at
"C6"
(I have this in a variable) I need to know how to get the value from
"A6".
How do I do this?

--
Regards

Rick
XP Pro
Office 2007





All times are GMT +1. The time now is 01:30 PM.

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