Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mac Mac is offline
external usenet poster
 
Posts: 213
Default Logical test if cell uses formatting..

Is there a logical test to check if, for example, a cell contents is in bold?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 772
Default Logical test if cell uses formatting..

As far as I know there is nothing built in, I built this function for someone
that counts cells that are bold, you can use it or modify, I can help you
modify it to your purpose if you need to. It goes in a module, preferably in
your personal.xls.

Function CountBold(rRange As Range) As Long
Dim lCount As Long, myCell As Range
lCount = 0
For Each myCell In rRange
If myCell.Font.bold = True Then
lCount = lCount + 1
End If
Next myCell
CountBold = lCount
End Function
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Mac" wrote:

Is there a logical test to check if, for example, a cell contents is in bold?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Logical test if cell uses formatting..

Note that changing the formatting within rRange doesn't cause this to
recalculate. You could add

Application.Volatile

after the Dim statement, but you'd still need to manually calculate the
sheet to ensure that the result is correct.



In article ,
John Bundy (remove) wrote:

As far as I know there is nothing built in, I built this function for someone
that counts cells that are bold, you can use it or modify, I can help you
modify it to your purpose if you need to. It goes in a module, preferably in
your personal.xls.

Function CountBold(rRange As Range) As Long
Dim lCount As Long, myCell As Range
lCount = 0
For Each myCell In rRange
If myCell.Font.bold = True Then
lCount = lCount + 1
End If
Next myCell
CountBold = lCount
End Function

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
IF functionality, Logical Test = Nonbalnk Cell Reebis Excel Worksheet Functions 1 April 23rd 07 02:28 PM
logical test Ron Coderre Excel Worksheet Functions 0 August 7th 06 08:02 PM
Logical Test comparison using cell color chamuko Excel Discussion (Misc queries) 2 November 9th 05 03:09 AM
logical test for each and every cell in range matt Excel Discussion (Misc queries) 4 September 16th 05 06:11 AM
=IF logical test to search only part of a cell Robbie in Houston Excel Worksheet Functions 2 March 5th 05 05:09 AM


All times are GMT +1. The time now is 06:54 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"