Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Border Problem

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Border Problem

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Border Problem

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Border Problem


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" wrote in message
...
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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Border Problem

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
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
Problem with printing a border in Excel 2007 dlf Excel Discussion (Misc queries) 3 September 12th 09 09:14 PM
Border Problem Gizmo Excel Discussion (Misc queries) 2 May 10th 08 03:53 PM
Cell border problem Brian Excel Discussion (Misc queries) 2 July 31st 07 07:44 PM
Default Border Color Problem Bobbie Excel Discussion (Misc queries) 1 May 25th 05 06:33 AM
Border problem with one row but no snag in many rows Hari[_3_] Excel Programming 3 September 7th 04 04:32 PM


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