Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subtracting ONLY the last value in a column Gambituk New Users to Excel 1 July 18th 10 02:45 PM
Column sum incorrect upon subtracting Drew Excel Discussion (Misc queries) 4 November 23rd 09 10:22 PM
Subtracting figures in a column Ron O'Brien New Users to Excel 4 October 8th 09 02:09 PM
Adding or subtracting numbers from a column Richard[_4_] Excel Discussion (Misc queries) 2 January 28th 08 12:41 PM
Subtracting two Subtotals in the same column David T Excel Discussion (Misc queries) 3 August 30th 06 08:26 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"