Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Find the last Cell in a column in VB

Or more simply:

LastRow = range("C:C").SpecialCells(xlCellTypeLastCell).Row

regards

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Find the last Cell in a column in VB

Which is not reliable if used range has not been re-set.

Enter data in column C down to row 100 then run the code which will return
100

lastrow = Range("C:C").SpecialCells(xlCellTypeLastCell).Row
MsgBox lastrow

Clear Contents from C51:C100 then run again.

You still get 100


Gord Dibben MS Excel MVP


On Thu, 11 Dec 2008 13:54:12 -0800 (PST), Coder1215
wrote:

Or more simply:

LastRow = range("C:C").SpecialCells(xlCellTypeLastCell).Row

regards


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
Maddening Dilemma - Compare each cell within column a to each cell in column b and find unique matches [email protected] Excel Worksheet Functions 66 May 1st 23 03:44 AM
Find max value in one column and return the value of corrosponding cell in different column [email protected] Excel Worksheet Functions 5 October 16th 07 12:33 PM
find first empty cell in column and start transpose next row in that cell ali Excel Programming 3 July 21st 07 03:12 PM
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
Move Cell in Column A to Column B when FIND juan Excel Programming 2 April 6th 04 10:20 PM


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