ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2002 - Borders(xlInsideVertical).LineStyle=xlcontinuous notworking (https://www.excelbanter.com/excel-programming/408181-excel-2002-borders-xlinsidevertical-linestyle%3Dxlcontinuous-notworking.html)

Yajiv

Excel 2002 - Borders(xlInsideVertical).LineStyle=xlcontinuous notworking
 
I have excel 2002 running in my server.
I tried to format a sheet with macro.
The
sheet.range.borderaround xlcontinuous is working
but sheet.range.borders(xlinsidevertical).linestyle=xl continuous is
not working
is there any other way to do the above formatting?

Rick Rothstein \(MVP - VB\)[_1531_]

Excel 2002 - Borders(xlInsideVertical).LineStyle=xlcontinuous not working
 
Try it using Cells; something like this...

Worksheets("Sheet1").Range("C5:F8").Cells.Borders( xlInsideVertical).LineStyle
= xlContinuous

Rick


"Yajiv" wrote in message
...
I have excel 2002 running in my server.
I tried to format a sheet with macro.
The
sheet.range.borderaround xlcontinuous is working
but sheet.range.borders(xlinsidevertical).linestyle=xl continuous is
not working
is there any other way to do the above formatting?



Rick Rothstein \(MVP - VB\)[_1532_]

Excel 2002 - Borders(xlInsideVertical).LineStyle=xlcontinuous not working
 
I meant to add... the idea being that without "Cells", Borders refers to the
border around the specified range; with "Cells", Borders refers to the
border around individual cells within the range.

Rick


"Rick Rothstein (MVP - VB)" wrote in
message ...
Try it using Cells; something like this...

Worksheets("Sheet1").Range("C5:F8").Cells.Borders( xlInsideVertical).LineStyle
= xlContinuous

Rick


"Yajiv" wrote in message
...
I have excel 2002 running in my server.
I tried to format a sheet with macro.
The
sheet.range.borderaround xlcontinuous is working
but sheet.range.borders(xlinsidevertical).linestyle=xl continuous is
not working
is there any other way to do the above formatting?




Peter T

Excel 2002 - Borders(xlInsideVertical).LineStyle=xlcontinuous not working
 
Hi Rick,

With your example that changes the inside borders it wouldn't make any
difference to use .Range("C5:F8").Cells.etc or .Range("C5:F8").etc.

When applying 'inside' borders each area in the range must include at least
two columns or two rows if applying vertical or horizontal borders
respectively. The four 'edge' borders and 'diagonal' borders can be applied
to any size range, even a single cell.

The OP's code and objective was somewhat vague and ambiguous, but maybe the
above explains why it is failing. Or maybe if the objective is to apply the
format to the entire sheet -

ws.Cells.Borders(xlInsideVertical).LineStyle = xlContinuous
where 'ws' is a reference to the worksheet.

Regards,
Peter T


"Rick Rothstein (MVP - VB)" wrote in
message ...
I meant to add... the idea being that without "Cells", Borders refers to

the
border around the specified range; with "Cells", Borders refers to the
border around individual cells within the range.

Rick


"Rick Rothstein (MVP - VB)" wrote in
message ...
Try it using Cells; something like this...


Worksheets("Sheet1").Range("C5:F8").Cells.Borders( xlInsideVertical).LineStyl
e
= xlContinuous

Rick


"Yajiv" wrote in message
...
I have excel 2002 running in my server.
I tried to format a sheet with macro.
The
sheet.range.borderaround xlcontinuous is working
but sheet.range.borders(xlinsidevertical).linestyle=xl continuous is
not working
is there any other way to do the above formatting?







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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com