![]() |
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 |
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 |
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 |
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. |
All times are GMT +1. The time now is 05:26 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com