Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default BorderAround won't go away

Can someone explain why I still have a xlThick border around my range after I
run this procedu

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default BorderAround won't go away

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 procedu

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default BorderAround won't go away

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" wrote in message
...
Can someone explain why I still have a xlThick border around my range
after I
run this procedu

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default BorderAround won't go away

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

"JLGWhiz" wrote in message
...
Can someone explain why I still have a xlThick border around my range
after I
run this procedu

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


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default BorderAround won't go away

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

"Vasant Nanavati" <vasantn AT aol DOT com wrote in message
...
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" wrote in message
...
Can someone explain why I still have a xlThick border around my range
after I
run this procedu

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
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
Clear BorderAround in VBA EagleOne Excel Discussion (Misc queries) 16 December 7th 06 02:16 PM
BorderAround method failure [email protected] Excel Programming 4 December 18th 05 06:47 PM
Range.BorderAround(xlLineStyleNone) John A Grandy Excel Programming 8 July 27th 03 05:32 PM


All times are GMT +1. The time now is 03:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"