Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Function to Check Borders

Changing the format of a cell won't cause excel to recalculate. You can tell
excel to recalculate the UDF the next time it recalculates, but that means you
could be one calculation behind.

Option Explicit
Function ThinBottomBorder(rng As Range) As Long
Application.Volatile
With rng.Cells(1).Borders(xlEdgeBottom)
If .Weight = xlThin _
And .LineStyle < xlNone Then
ThinBottomBorder = 1
Else
ThinBottomBorder = 0
End If
End With
End Function

This also checks to see if the linestyle is actually used (different from
xlNone).

=personal.xls!thinbottomborder(a1)




Marco wrote:

I have a different issue now, it is returning a 1 in cells that do not have a
bottom border as well as the one that does.

"egun" wrote:

Don't you need something like ='Personal.xls'!Module28.MacroName??? If
you're trying to use a UDF from your Personal macro workbook in a different
workbook, you need to have the entire reference to that macro or you get the
#NAME error, which is telling you it doesn't know what "MacroName" is.

HTH,

Eric


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check for # of Words in Function msnyc07 Excel Worksheet Functions 2 February 14th 10 02:03 AM
Please check my use of the ACCRINTM function. Nth Excel Worksheet Functions 10 September 28th 08 06:01 PM
Check my IF function KH_GS Excel Worksheet Functions 7 April 6th 06 09:28 AM
check box function? scott Excel Worksheet Functions 1 December 29th 05 07:58 PM
Function to set borders of cell Des Excel Worksheet Functions 1 April 23rd 05 03:17 PM


All times are GMT +1. The time now is 05:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"