View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default UDF - detect cell border

Jason,

Try something like

Function HasBorder(Rng As Range) As Boolean
If Rng.Borders(xlEdgeTop).LineStyle < xlNone Or _
Rng.Borders(xlEdgeBottom).LineStyle < xlNone Then
HasBorder = True
Else
HasBorder = False
End If
End Function


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Jason Morin" wrote in message
...
I'm struggling with a simple UDF (it might require 2). I'd
like to return TRUE/FALSE if a cell has a top *or* bottom
border. Something like:

Function IsBorder(cell As Range) As Boolean
IsBorder = cell.Borders(xlEdgeTop)
End Function

Thanks!
Jason