ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Border question (https://www.excelbanter.com/excel-programming/364455-border-question.html)

[email protected]

Border question
 
Thanks for all the help so far guys. One more question.

Here's a snippet of code from my current project:

With Worksheet
..Range("A1:C2").Borders.LineStyle = WdLineStyleSingle
End With

I always compile with:

Option Explicit

So when I try to run this subject, I get the error:

Compile error:
Variable not defined

Isn't WdLineStyleSingle built in? Do I need to Dim it?

Is WdLineStyleSingle just some constant where I can substitute the
actual value (just use 2 or whatever the value is) instead?

Thanks again for the great help.


Dave Peterson

Border question
 
WdLineStyleSingle sure looks like a constant from MSWord.

I think you want one of these:

XlLineStyle can be one of these XlLineStyle constants.
xlContinuous
xlDash
xlDashDot
xlDashDotDot
xlDot
xlDouble
xlSlantDashDot
xlLineStyleNone



wrote:

Thanks for all the help so far guys. One more question.

Here's a snippet of code from my current project:

With Worksheet
.Range("A1:C2").Borders.LineStyle = WdLineStyleSingle
End With

I always compile with:

Option Explicit

So when I try to run this subject, I get the error:

Compile error:
Variable not defined

Isn't WdLineStyleSingle built in? Do I need to Dim it?

Is WdLineStyleSingle just some constant where I can substitute the
actual value (just use 2 or whatever the value is) instead?

Thanks again for the great help.


--

Dave Peterson


All times are GMT +1. The time now is 03:39 PM.

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