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: 390
Default Apply Border to range when first cell has text.


I need to apply a Top border starting from column A to the LastCol for any
row where text is detected in that cell of column A. The range for the
detection process is from A5:A56. Thanks

LastCol = Cells(3, Columns.Count).End(xlToLeft).Column

With Range(Cells(2, 1), Cells(2, LastCol + 5))
.Borders(xlEdgeTop).LineStyle = xlNone
End With

With Range(Cells(2, 1), Cells(2, LastCol))
.Borders(xlEdgeTop).Weight = xlThick
End With

As an example if cell A11 contained any text then a top border would be
applied starting from A11 to the last column. The last column (LastCol) is
an interger that changes depending a cell.

Bill
 
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
Text overlapping cell border above it kesdex Excel Discussion (Misc queries) 4 March 14th 08 05:26 PM
How to apply a name to a cell range Stephen Francis M Excel Discussion (Misc queries) 15 January 7th 08 10:35 AM
Apply Hyperlink to Text in Cell Elaine Excel Discussion (Misc queries) 1 January 18th 06 06:50 PM
Apply Border Bill Excel Programming 6 July 29th 05 12:15 AM
Apply Border based on last Day of Month Bill Excel Programming 2 July 22nd 05 07:57 PM


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