Does borders exist ?

P

PdeC

Hello.
I wish to write a macro that tells me if a cell has a border and if this
border is a left one or a bottom one or both.
Thanks for an help.

Pierre
 
D

Dave Peterson

Option Explicit
Sub testme()
With ActiveSheet.Range("a1")
If .Borders(xlEdgeLeft).LineStyle = xlNone Then
MsgBox "No left border"
End If
If .Borders(xlEdgeBottom).LineStyle = xlNone Then
MsgBox "No bottom border"
End If
End With
End Sub
 
P

PdeC

Thaks a lot.
Pierre

Dave Peterson a écrit :
Option Explicit
Sub testme()
With ActiveSheet.Range("a1")
If .Borders(xlEdgeLeft).LineStyle = xlNone Then
MsgBox "No left border"
End If
If .Borders(xlEdgeBottom).LineStyle = xlNone Then
MsgBox "No bottom border"
End If
End With
End Sub
 
Top