PC Review


Reply
Thread Tools Rate Thread

Border around range working -Border for cells within range not wor

 
 
=?Utf-8?B?R3dlbg==?=
Guest
Posts: n/a
 
      23rd Oct 2007
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
 
Reply With Quote
 
 
 
 
Bernie Deitrick
Guest
Posts: n/a
 
      23rd Oct 2007
? maybe remove these 2 lines

Borders(xlInsideHorizontal).LineStyle = xlNone


HTH,
Bernie
MS Excel MVP


"Gwen" <(E-Mail Removed)> wrote in message
news:0CF1E0AE-CFF2-403B-AB71-(E-Mail Removed)...
> 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



 
Reply With Quote
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      23rd Oct 2007
It seemed to work OK just using the xlInsideHorizontal or xlInsideVertical.
I commented out the others.

With RngAL8
'.Borders.LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlContinuous
.Borders(xlInsideHorizontal).Weight = xlThick

'.Borders(xlEdgeBottom).LineStyle = xlContinuous
'.Borders(xlEdgeBottom).Weight = xlThick

'.Borders(xlEdgeRight).LineStyle = xlContinuous
'.Borders(xlEdgeRight).Weight = xlThick

.Borders(xlInsideVertical).LineStyle = xlContinuous
.Borders(xlInsideVertical).Weight = xlThick

"Gwen" wrote:

> 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

 
Reply With Quote
 
=?Utf-8?B?R3dlbg==?=
Guest
Posts: n/a
 
      23rd Oct 2007
Thanks for your help.
Unfortunately I am not getting the top/bottom border lines

"JLGWhiz" wrote:

> It seemed to work OK just using the xlInsideHorizontal or xlInsideVertical.
> I commented out the others.
>
> With RngAL8
> '.Borders.LineStyle = xlNone
> .Borders(xlInsideHorizontal).LineStyle = xlContinuous
> .Borders(xlInsideHorizontal).Weight = xlThick
>
> '.Borders(xlEdgeBottom).LineStyle = xlContinuous
> '.Borders(xlEdgeBottom).Weight = xlThick
>
> '.Borders(xlEdgeRight).LineStyle = xlContinuous
> '.Borders(xlEdgeRight).Weight = xlThick
>
> .Borders(xlInsideVertical).LineStyle = xlContinuous
> .Borders(xlInsideVertical).Weight = xlThick
>
> "Gwen" wrote:
>
> > 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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I test a range of cells for the presence of a border? PFB Microsoft Excel Worksheet Functions 7 10th Nov 2008 05:19 AM
Border for range =?Utf-8?B?Ym9iZW5zXzgz?= Microsoft Excel Programming 1 20th Sep 2007 01:41 PM
Apply bottom border only on filled cells, leaves blank cells without border? StargateFan Microsoft Excel Programming 8 12th Apr 2007 12:25 PM
border every other cell in range cass calculator Microsoft Excel Programming 1 17th Aug 2006 05:16 PM
Body of page appears in Top Border, Left Border and Bottom Border (there is no right border) Michael Edwards Microsoft Frontpage 1 14th Oct 2004 09:46 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:11 PM.