LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Finding the last used cell in a column

I have a workbook that has several worksheets in it, once
of which is suppose to display the total balances from the
other worksheets. There are a total of 4 worksheets.

Worksheets 1 to 3 each have a column that has a running
balance. (I.e. Cell_Value = Previous_Cell + Additions -
Subtractions) These sheets will have an unknown number of
used cells as it will change each time data is entered.

I'm using Excel 97 (can't afford to buy a new version) and
want to select the last used cell in the specified column.
I can't seem to find a built in function, and am having
some trouble getting Excel to find my user-defined
function. (Excel won't recognize it.)

Thus far, I've written:

Public Function Get_Last_Cell_Value( _
ByRef Current_Worksheet As Worksheet, _
ByRef Current_Column As String) As Currency
Dim Total_Count_Of_Column As Integer
Dim Column As Range
Set Column = Current_Worksheet.Columns(,
Current_Column)
Total_Count_Of_Column = Column.Count
Get_Last_Cell_Value = Column.Cells
(Total_Count_Of_Column)
End Function

which should do the trick. The function is stored
in "ThisWorkbook". It's been a while since I've done VBA.
I don't usually program Excel. Am I missing something? Is
there an easier way to do this? I'd rather avoid building
a macro if I can for security reasons.

Help much appreciated.

Ben
 
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
Finding First Empty Cell in a Column TomHull Excel Discussion (Misc queries) 5 November 9th 09 01:19 AM
Finding First Empty Cell in a Column TomHull Excel Discussion (Misc queries) 0 November 9th 09 12:21 AM
Finding a cell and returning value from a different row and column RJBohn3 Excel Discussion (Misc queries) 1 May 23rd 09 01:13 AM
Finding last cell with data in a column Nigel Bennett Setting up and Configuration of Excel 2 April 29th 05 08:03 PM
Finding next Blank Cell in Column trickdos[_3_] Excel Programming 2 May 19th 04 04:33 PM


All times are GMT +1. The time now is 04:55 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"