Does borders exist ?

  • Thread starter Thread starter PdeC
  • Start date Start date
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
 
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
 
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
 
Back
Top