PDA

View Full Version : Solved: check if a cell has a bottom border



crmpicco
01-09-2006, 03:18 AM
Is there anyway to check if a cell has a bottom border?

Picco

http://vbaexpress.com/forum/images/smilies/notworthy.gif

Bob Phillips
01-09-2006, 03:23 AM
If ActiveCell.Borders(xlEdgeBottom).LineStyle <> xlLineStyleNone Then
MsgBox "Yes it does"
End If

crmpicco
01-09-2006, 03:24 AM
If Range(sPeriodRange).Borders(xlEdgeBottom).LineStyle <> xlNone Then
bBuildFare = True
End If


Is there a way to do it with Range(RANGE)?

I have code like this above.

Bob Phillips
01-09-2006, 03:34 AM
If Range("A2:A10").Borders(xlEdgeBottom).LineStyle <> xlLineStyleNone Then
MsgBox "Yes it does"
End If


but this is only true if all cells have that border, if that is what you want.

crmpicco
01-09-2006, 08:45 AM
works:


ElseIf Range(sTempRange).Borders(xlEdgeBottom).Weight <> 2 Then