Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Finding the last non bank cell in a column

Hi
Hopefully a simple question - how do you find the last non blank cell in
a column ? The trick is that the column may contain blank cells along
the way before reaching the last non blank cell.

TIA
Andrew Bourke
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Finding the last non bank cell in a column

Hi,

lastrow = Cells(Rows.Count, "A").End(xlUp).Row ' Last row in column A
lastcell = Cells(lastrow, "A")


HTH

"Andrew B" wrote:

Hi
Hopefully a simple question - how do you find the last non blank cell in
a column ? The trick is that the column may contain blank cells along
the way before reaching the last non blank cell.

TIA
Andrew Bourke

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Finding the last non bank cell in a column

Here is an approach for last row and last column.

Dim lrow As Long, lcol As Integer

' last row of non-empty cell in column 1
lrow = Cells(Rows.Count, 1).End(xlUp).Row

'last column of non-empty cell in row 1
lcol = Cells(1, Columns.Count).End(xlToLeft).Column

--
Cheers
Nigel



"Andrew B" wrote in message
...
Hi
Hopefully a simple question - how do you find the last non blank cell in
a column ? The trick is that the column may contain blank cells along
the way before reaching the last non blank cell.

TIA
Andrew Bourke



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Finding the last non bank cell in a column


something like

LastCellInColumnA = Range("A65536").End(xlUp).Offset(1, 0).Address

Just subst the column .....

--
Ivan F Moal

-----------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php...nfo&userid=195
View this thread: http://www.excelforum.com/showthread.php?threadid=38029

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
A running-balance column in a bank-tracking table DeeDeeCee New Users to Excel 7 September 5th 07 11:37 AM
What is the formula for bank account row balance column Hazeldean Excel Worksheet Functions 2 May 17th 05 04:34 AM
Finding Cell Interior Colour of First Cell in Column ExcelMonkey[_190_] Excel Programming 4 March 22nd 05 03:01 AM
Finding column of a particular cell Prema Excel Programming 4 February 7th 05 06:44 PM
Finding the last used cell in a column Ben's Oak Excel Programming 5 July 16th 04 04:12 AM


All times are GMT +1. The time now is 09:27 AM.

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

About Us

"It's about Microsoft Excel"