PC Review


Reply
Thread Tools Rate Thread

Border Problem

 
 
Gary''s Student
Guest
Posts: n/a
 
      13th Mar 2008
In a worksheet, I have borders around cells C5 and E8 and F4 and each cell in
D15:G19.

When I run:

Sub next_tryx()
Range("A1:G19").Borders(xlEdgeBottom).LineStyle = xlNone
End Sub

The only borders that get cleared are the ones on the last row (D19:G19).

Why not the others?
--
Gary''s Student - gsnu200773
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      13th Mar 2008
Hey GS, you probably have to use xlInsideHorizontal.

"Gary''s Student" wrote:

> In a worksheet, I have borders around cells C5 and E8 and F4 and each cell in
> D15:G19.
>
> When I run:
>
> Sub next_tryx()
> Range("A1:G19").Borders(xlEdgeBottom).LineStyle = xlNone
> End Sub
>
> The only borders that get cleared are the ones on the last row (D19:G19).
>
> Why not the others?
> --
> Gary''s Student - gsnu200773

 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      13th Mar 2008
P.S. extend your lower row by one to incorporate the last row of the range
you want to execute.

"Gary''s Student" wrote:

> In a worksheet, I have borders around cells C5 and E8 and F4 and each cell in
> D15:G19.
>
> When I run:
>
> Sub next_tryx()
> Range("A1:G19").Borders(xlEdgeBottom).LineStyle = xlNone
> End Sub
>
> The only borders that get cleared are the ones on the last row (D19:G19).
>
> Why not the others?
> --
> Gary''s Student - gsnu200773

 
Reply With Quote
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      13th Mar 2008

You specified xlEdgeBottom for the the specific box surrounding A1:G19, not
all the edges for the various bordered areas inside. I think this should do
what you want...

Range("A1:G19").Borders.LineStyle = xlLineStyleNone

Rick


"Gary''s Student" <(E-Mail Removed)> wrote in message
news:99A62636-1EAE-4F7F-AA55-(E-Mail Removed)...
> In a worksheet, I have borders around cells C5 and E8 and F4 and each cell
> in
> D15:G19.
>
> When I run:
>
> Sub next_tryx()
> Range("A1:G19").Borders(xlEdgeBottom).LineStyle = xlNone
> End Sub
>
> The only borders that get cleared are the ones on the last row (D19:G19).
>
> Why not the others?
> --
> Gary''s Student - gsnu200773


 
Reply With Quote
 
Stefi
Guest
Posts: n/a
 
      13th Mar 2008
I think because xlEdgeLeft, xlEdgeTop, etc. are independent properties and
borders of e.g. C5 are xlInsideVertical and xlInsideHorizontal relative to
Range("A1:G19").
You should use

With Range("A1:G19")
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
End With

if you want to remove all borders.

Regards,
Stefi


„Gary''s Student” ezt *rta:

> In a worksheet, I have borders around cells C5 and E8 and F4 and each cell in
> D15:G19.
>
> When I run:
>
> Sub next_tryx()
> Range("A1:G19").Borders(xlEdgeBottom).LineStyle = xlNone
> End Sub
>
> The only borders that get cleared are the ones on the last row (D19:G19).
>
> Why not the others?
> --
> Gary''s Student - gsnu200773

 
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
page border problems bottom border missing mikeeeee Microsoft Word Document Management 0 12th Oct 2009 09:31 AM
Help-Have a border problem =?Utf-8?B?Q2F0dA==?= Microsoft Frontpage 7 14th Apr 2006 10:46 PM
Changing the border of one cell s/n change the border of adjacent =?Utf-8?B?Z2phbnNzZW5tbg==?= Microsoft Excel Misc 2 5th Oct 2005 08:35 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
Re: Want black vertical border to show up over gray horizontal border CLR Microsoft Excel Misc 0 15th Jul 2004 07:07 PM


Features
 

Advertising
 

Newsgroups
 


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