Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default is there a formula/macro/script that recognizes formatting?

Dear listers:

I have been given an excel spreadsheet that contains a person's
selections from a menu of options.

However rather than just having the choice listed next to the person's
name, I have the entire menu listed next to each person and that
person's choice is in bold.

Is there a formula of the following type:
give me a 1 if specified text is bold and a 0 otherwise?

Here is an example. The following information is in one cell:
"o Aceptó
o No Aceptó
o No Asistió
o No es elegible"

A person's choice is in bold. I need to analyse the data and want a
formula/macro/script that gives me a new cell with a value of 1 if
answer=bold and 0 if not.

Immensely grateful for any tips/solutions.

Not a very skilled excel user
Amer
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default is there a formula/macro/script that recognizes formatting?


You can individually select any character or characters to be bold or
not to be bold (that is the question). The code below is only checking
the 1st character.

Function ISBold(Target As Range)
'
With Target.Characters(Start:=1, Length:=1).Font
If .FontStyle = "Bold" Then
ISBold = True
Else
ISBold = False
End If
End With
End Function


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=149273

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default is there a formula/macro/script that recognizes formatting?

This one will count 1 or 0 if the entire cell is bold.

Function CountBold(rg As Range) As Long
''originally posted by Ron Rosenfeld
Dim c As Range
For Each c In rg
CountBold = CountBold - c.Font.Bold
Next c
End Function

But I don't know how to return a 1 or 0 if only part of a 4-line cell is
bold.

Maybe you could have choices in separate cells.


Gord Dibben MS Excel MVP

On Thu, 29 Oct 2009 22:47:07 +0000, joel
wrote:


You can individually select any character or characters to be bold or
not to be bold (that is the question). The code below is only checking
the 1st character.

Function ISBold(Target As Range)
'
With Target.Characters(Start:=1, Length:=1).Font
If .FontStyle = "Bold" Then
ISBold = True
Else
ISBold = False
End If
End With
End Function


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default is there a formula/macro/script that recognizes formatting?

But I don't know how to return a 1 or 0 if only part of a 4-line cell is
bold.


Cell.Characters(Start:=2, Length:=1).Font.Bold

That just checks if the second character is bold. The next trick is
working out where the lines begin.

Phil Hibbs.
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
SCRIPT: custom formatting nastech Excel Discussion (Misc queries) 0 April 27th 06 04:54 PM
How do I type this so excel recognizes it? fronty Excel Worksheet Functions 2 April 16th 06 03:10 PM
If formula that recognizes #N/A Box815 Excel Discussion (Misc queries) 2 March 17th 06 03:26 PM
Formula that recognizes duplicates Courtneyf04 Excel Worksheet Functions 7 June 8th 05 07:06 PM
Conditional Formatting script Andy Excel Programming 3 December 20th 03 02:20 PM


All times are GMT +1. The time now is 12:37 AM.

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

About Us

"It's about Microsoft Excel"