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: 54
Default Border around range working -Border for cells within range not wor

Hi,
Please assist.

I want a thick border around range and a5:l8
I want thin borders around cells in range from a5 to the end of range.

The below code gives me the thick borders I want not the cells within the
range.

Set rngAL8 = Range(Cells(Rows.Count, "A").End(xlUp), Range("l5"))

With rngAL8
'.Borders.LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlContinuous
.Borders(xlInsideHorizontal).Weight = xlHairline

.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeBottom).Weight = xlHairline

.Borders(xlEdgeRight).LineStyle = xlContinuous
.Borders(xlEdgeRight).Weight = xlHairline

.Borders(xlInsideVertical).LineStyle = xlContinuous
.Borders(xlInsideVertical).Weight = xlHairline
End With


Set rng = Range(Cells(Rows.Count, "A").End(xlUp), Range("l1"))
With rng
..Borders(xlInsideHorizontal).LineStyle = xlNone
..Borders(xlEdgeLeft).Weight = xlThick
..Borders(xlEdgeRight).Weight = xlThick
..Borders(xlEdgeTop).Weight = xlThick
..Borders(xlEdgeBottom).Weight = xlThick
End With

Set rnga5l7 = Range("A5:L7")
With rnga5l7
..Borders(xlInsideHorizontal).LineStyle = xlNone
..Borders(xlEdgeLeft).Weight = xlThick
..Borders(xlEdgeRight).Weight = xlThick
..Borders(xlEdgeTop).Weight = xlThick
..Borders(xlEdgeBottom).Weight = xlThick
End With

Thanks
 
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
How can I test a range of cells for the presence of a border? PFB Excel Worksheet Functions 7 November 10th 08 05:19 AM
Border for range bobens_83 Excel Programming 1 September 20th 07 01:41 PM
Apply bottom border only on filled cells, leaves blank cells without border? StargateFan[_3_] Excel Programming 4 April 8th 07 05:39 PM
border every other cell in range cass calculator Excel Programming 0 August 17th 06 04:56 PM
border every other cell in range cass calculator Excel Programming 0 August 17th 06 04:53 PM


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