PC Review


Reply
Thread Tools Rate Thread

BorderAround won't go away

 
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      21st Jun 2007
Can someone explain why I still have a xlThick border around my range after I
run this procedure:

Sub brdrs()
Range("C3:G8").BorderAround Weight:=xlThick, _
ColorIndex:=xlColorIndexAutomatic
MsgBox "Check Border"
Range("C3:G8").BorderAround LineStyle:=-4142
Range("C3:G8").BorderAround LineStyle:=xlLineStyleNone
Range("C3:G8").BorderAround LineStyle:=xlNone
End Sub

 
Reply With Quote
 
 
 
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      21st Jun 2007
The VBA help instructions are misleading. The correct syntax should be

Range("C3:G8").Borders.LineStyle = xlNone

"JLGWhiz" wrote:

> Can someone explain why I still have a xlThick border around my range after I
> run this procedure:
>
> Sub brdrs()
> Range("C3:G8").BorderAround Weight:=xlThick, _
> ColorIndex:=xlColorIndexAutomatic
> MsgBox "Check Border"
> Range("C3:G8").BorderAround LineStyle:=-4142
> Range("C3:G8").BorderAround LineStyle:=xlLineStyleNone
> Range("C3:G8").BorderAround LineStyle:=xlNone
> End Sub
>

 
Reply With Quote
 
Vasant Nanavati
Guest
Posts: n/a
 
      21st Jun 2007
It's counterintuitive, but you have to remove them individually:

Sub brdrs()
With Range("C3:G8")
.BorderAround Weight:=xlThick, ColorIndex:=xlColorIndexAutomatic
MsgBox "Check Border"
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
End With
End Sub
_____________________________________________________________________

"JLGWhiz" <(E-Mail Removed)> wrote in message
newsF80706A-756D-43C6-AAA0-(E-Mail Removed)...
> Can someone explain why I still have a xlThick border around my range
> after I
> run this procedure:
>
> Sub brdrs()
> Range("C3:G8").BorderAround Weight:=xlThick, _
> ColorIndex:=xlColorIndexAutomatic
> MsgBox "Check Border"
> Range("C3:G8").BorderAround LineStyle:=-4142
> Range("C3:G8").BorderAround LineStyle:=xlLineStyleNone
> Range("C3:G8").BorderAround LineStyle:=xlNone
> End Sub
>



 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      21st Jun 2007
Sub brdrs()
Range("C3:G8").BorderAround Weight:=xlThick, _
ColorIndex:=xlColorIndexAutomatic
MsgBox "Check Border"
Range("C3:G8").Borders.LineStyle = xlNone
End Sub

--
Don Guillett
SalesAid Software
(E-Mail Removed)
"JLGWhiz" <(E-Mail Removed)> wrote in message
newsF80706A-756D-43C6-AAA0-(E-Mail Removed)...
> Can someone explain why I still have a xlThick border around my range
> after I
> run this procedure:
>
> Sub brdrs()
> Range("C3:G8").BorderAround Weight:=xlThick, _
> ColorIndex:=xlColorIndexAutomatic
> MsgBox "Check Border"
> Range("C3:G8").BorderAround LineStyle:=-4142
> Range("C3:G8").BorderAround LineStyle:=xlLineStyleNone
> Range("C3:G8").BorderAround LineStyle:=xlNone
> End Sub
>


 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      21st Jun 2007
See my post

--
Don Guillett
SalesAid Software
(E-Mail Removed)
"Vasant Nanavati" <vasantn AT aol DOT com> wrote in message
news:(E-Mail Removed)...
> It's counterintuitive, but you have to remove them individually:
>
> Sub brdrs()
> With Range("C3:G8")
> .BorderAround Weight:=xlThick, ColorIndex:=xlColorIndexAutomatic
> MsgBox "Check Border"
> .Borders(xlEdgeLeft).LineStyle = xlNone
> .Borders(xlEdgeTop).LineStyle = xlNone
> .Borders(xlEdgeBottom).LineStyle = xlNone
> .Borders(xlEdgeRight).LineStyle = xlNone
> End With
> End Sub
> _____________________________________________________________________
>
> "JLGWhiz" <(E-Mail Removed)> wrote in message
> newsF80706A-756D-43C6-AAA0-(E-Mail Removed)...
>> Can someone explain why I still have a xlThick border around my range
>> after I
>> run this procedure:
>>
>> Sub brdrs()
>> Range("C3:G8").BorderAround Weight:=xlThick, _
>> ColorIndex:=xlColorIndexAutomatic
>> MsgBox "Check Border"
>> Range("C3:G8").BorderAround LineStyle:=-4142
>> Range("C3:G8").BorderAround LineStyle:=xlLineStyleNone
>> Range("C3:G8").BorderAround LineStyle:=xlNone
>> End Sub
>>

>
>


 
Reply With Quote
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      22nd Jun 2007
Thanks for the responses, I guess I should have made the post as a comment.
The VBA help instructions imply that you can use the syntax that I originally
posted, although I had not use that method before. When I could not get it
to work, I thought maybe there was a glitch in the software. Then I realized
that it was just another poorly written remark in the VBA help files. That's
why I did the second posting.

Thanks again for caring. JLG

"Don Guillett" wrote:

> See my post
>
> --
> Don Guillett
> SalesAid Software
> (E-Mail Removed)
> "Vasant Nanavati" <vasantn AT aol DOT com> wrote in message
> news:(E-Mail Removed)...
> > It's counterintuitive, but you have to remove them individually:
> >
> > Sub brdrs()
> > With Range("C3:G8")
> > .BorderAround Weight:=xlThick, ColorIndex:=xlColorIndexAutomatic
> > MsgBox "Check Border"
> > .Borders(xlEdgeLeft).LineStyle = xlNone
> > .Borders(xlEdgeTop).LineStyle = xlNone
> > .Borders(xlEdgeBottom).LineStyle = xlNone
> > .Borders(xlEdgeRight).LineStyle = xlNone
> > End With
> > End Sub
> > _____________________________________________________________________
> >
> > "JLGWhiz" <(E-Mail Removed)> wrote in message
> > newsF80706A-756D-43C6-AAA0-(E-Mail Removed)...
> >> Can someone explain why I still have a xlThick border around my range
> >> after I
> >> run this procedure:
> >>
> >> Sub brdrs()
> >> Range("C3:G8").BorderAround Weight:=xlThick, _
> >> ColorIndex:=xlColorIndexAutomatic
> >> MsgBox "Check Border"
> >> Range("C3:G8").BorderAround LineStyle:=-4142
> >> Range("C3:G8").BorderAround LineStyle:=xlLineStyleNone
> >> Range("C3:G8").BorderAround LineStyle:=xlNone
> >> End Sub
> >>

> >
> >

>
>

 
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
BorderAround Method yjaeseok Microsoft Excel Programming 0 5th Feb 2010 01:15 AM
Clear BorderAround in VBA EagleOne Microsoft Excel Misc 16 7th Dec 2006 02:16 PM
BorderAround method failure johnhildreth@citynet.net Microsoft Excel Programming 4 18th Dec 2005 06:47 PM
Range.BorderAround(xlLineStyleNone) John A Grandy Microsoft Excel Programming 8 27th Jul 2003 05:32 PM


Features
 

Advertising
 

Newsgroups
 


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