Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Cells(Rows.Count, "b").End(xlUp).Row

So, you can use the formula in the subject line (Cells(Rows.Count,
"b").End(xlUp).Row) to select the last cell in the column. But, I have
a table with a variable number of rows, which will most likely be
empty.

So instead of selecting the last cell with a value in it, I want to
select hte last cell with a border around it.

How?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cells(Rows.Count, "b").End(xlUp).Row


Will this work for you?

Sub LastBorder()
Dim myCell As String
Range("B:B").Select '<===You can change this to whatever range you
want
For Each cell In Selection
If cell.Borders(xlEdgeBottom).LineStyle = xlNone Then
GoTo fin
End If
myCell = cell.Address
Next cell
fin:
If myCell < "" Then
Range(myCell).Select
Else
Range("B1").Select
End If
End Sub


--
Ikaabod
------------------------------------------------------------------------
Ikaabod's Profile: http://www.excelforum.com/member.php...o&userid=33371
View this thread: http://www.excelforum.com/showthread...hreadid=545352

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
Count cells that contain "Y" in columnA IF contains"X" in columnB holliedavis Excel Worksheet Functions 6 July 20th 06 06:12 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
inalRow = Range("A65536").End(xlUp).Row ciba1234[_2_] Excel Programming 2 September 15th 05 10:28 PM
S1.Range("D65536").End(xlUp).Select Rick[_19_] Excel Programming 6 January 13th 04 01:24 AM
Question about "End(xlUp)" property Chip Pearson Excel Programming 0 August 4th 03 02:57 AM


All times are GMT +1. The time now is 03:05 PM.

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"