View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Leith Ross[_5_] Leith Ross[_5_] is offline
external usenet poster
 
Posts: 1
Default last row value in a range


Hello Alvin,

Here is an example. The data is in column "A" on "Sheet1". The TextBo
on the UserForm is TextBox1.


LastRow = Application.WorksheetFunction.CountA("A:A")

TextBox1.Text = Sheets("Sheet1").Cells(LastRow, 1)

__________________________________________________ _______________

The CountA function counts any type of information, including empt
text ("") but not including empty cells. If an argument is an array o
reference, empty cells within the array or reference are ignored. I
you do not need to count logical values, text, or error values, use th
COUNT function.

Also, when changing your column from "A" to whatever, Cells functio
reference is Cells(Row, Column).
__________________________________________________ _______________

Hope this helps,
Leith Ros

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=34585