borders
Hi,
how about something like this:
Function HasBorder(Cell As Range) As Boolean
Dim i As Variant
For Each i In Array(xlDiagonalDown, xlDiagonalUp, _
xlEdgeLeft, xlEdgeTop, xlEdgeBottom, xlEdgeRight)
If Cell(1).Borders(i).LineStyle < xlLineStyleNone Then
HasBorder = True
Exit For
End If
Next
End Function
Sub Test()
If HasBorder(ActiveCell) Then
End If
End Sub
this also detects borders of adjacent cells. if you don't want them,
use xlLeft, xlTop, xlBottom and xlRight instead of xlEdge***.
(even if a cell has no borders, adjacent cells may display borders)
this doesn't detect borders displayed by a conditional formatting.
perhaps there is no easy way to detect them without evaluating
conditions.
--
HTH,
okaizawa
jobra wrote:
Is there a way to check wether an active cell is bordered?
If ActiveCell is bordered Then
--- action ---
End If
Thank you very much in advance
|