Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Need value of last number in a column

I have a column of numbers (stock prices) that I am updating daily. I want
to use the last value I entered in the column to calculate my losses (current
price - fixed beginning stock price). I can get the Row number with the ROW
function, but am unsuccessful when trying to use this number in a Cell
reference:
i.e. +C=ROW(A55) -- where C is the column and =ROW(A55) will return 55
(contents of Cell 55 being what I am after).
Is there a way I can get this Cell reference to work or is there another
function or method I can use to determine the last value in a column.
--
Ron Smith in Round Rock
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default Need value of last number in a column

Give this snippet a go...

Assign it to a variable: myCellValue = Cells(Rows.Count,
3).End(xlUp).Value

Then you can utilize "myCellValue" somewhere else in your code.

If you are looking for a user defined function, take a look at the following
from http://www.mvps.org/dmcritchie/excel/lastcell.htm

' Apply this function to a new module in your workbook
Function LastInColumn(rng As Range) As Variant
LastInColumn = Cells(Rows.Count, rng(1).Column).End(xlUp).Value
End Function

Then you can reference it on your worksheet with the following function
call:

=LastInColumn(C:C)



"Ron Smith" wrote in message
...
I have a column of numbers (stock prices) that I am updating daily. I
want
to use the last value I entered in the column to calculate my losses
(current
price - fixed beginning stock price). I can get the Row number with the
ROW
function, but am unsuccessful when trying to use this number in a Cell
reference:
i.e. +C=ROW(A55) -- where C is the column and =ROW(A55) will return 55
(contents of Cell 55 being what I am after).
Is there a way I can get this Cell reference to work or is there another
function or method I can use to determine the last value in a column.
--
Ron Smith in Round Rock


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
inverse of the column function? i.e. input a number, output thecorresponding column text label Brotherharry Excel Worksheet Functions 19 February 14th 09 12:37 AM
How do I turn excel columns from column number to column letter? column Setting up and Configuration of Excel 1 April 29th 08 10:15 AM
Count number of cells and total in one column, based on another column suffix Pierre Excel Worksheet Functions 5 October 31st 07 12:28 AM
Display missing Part Number if Column A does not match column B Erik T Excel Worksheet Functions 2 April 17th 06 11:23 PM
Auto number w/ different letter-number combos in same column Colleen B Excel Worksheet Functions 2 February 23rd 05 02:41 PM


All times are GMT +1. The time now is 10:11 AM.

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"