Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Borders | Excel Discussion (Misc queries) | |||
Borders | Excel Programming | |||
borders | Excel Programming | |||
Deleting cell borders before file opening error occurs? | Excel Programming | |||
Borders | Excel Discussion (Misc queries) |