LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 333
Default Borders Error

Hi,

I've been having trouble with this. I keep getting an 'unable to get the
linestyle property of the border class' error message at the line "If
..Borders(xlEdgeTop).LineStyle < xlNone Then".

If I remove this line and go directly into Sub RemoveBorders, I get the
error on the first xlNone line.

Have I missed something?

Sub ChkCAMPool(ShName)

Debug.Print "Starting ChkCAMPool " & Sheets(ShName).Name

' Check if value in pools 10
' if value add borders to 2nd row of Pools
'Check CAM Pool

Dim Grid As Range

Set Grid = Sheets(ShName).Range("F34:N36")

With Grid
If Sheets(ShName).Range("F33").Value < "" Then

If .Borders(xlEdgeTop).LineStyle < xlThin Then
Call Formating.AddThinBorders(ShName, Grid)
End If
End If

If Sheets(ShName).Range("F33").Value = "" Then
If .Borders(xlEdgeTop).LineStyle < xlNone Then 'Error is
here
Call Formating.RemoveBorders(ShName, Grid)
End If
End If
End With

End Sub


Sub RemoveBorders(ShName, Grid As Range)

With Grid
.Borders(xlDiagonalDown).LineStyle = xlNone 'error is here
.Borders(xlDiagonalUp).LineStyle = xlNone
.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

End Sub
--
Thanks for your help.
Karen53
 
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
Borders DAH Mist Excel Discussion (Misc queries) 0 October 1st 07 10:24 PM
Borders Sandy Excel Programming 4 May 8th 07 05:14 PM
borders jobra Excel Programming 4 August 30th 05 10:55 AM
Deleting cell borders before file opening error occurs? timlow Excel Programming 4 July 8th 05 10:13 PM
Borders linda Excel Discussion (Misc queries) 2 January 28th 05 01:05 PM


All times are GMT +1. The time now is 09:07 PM.

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"