Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detecting Null
I want to detect whether part of the text in a cell is bolded,
underlined, or uses a special font. Rather than slow things down by looking at each character, I thought I could just detect whether any part of the text in the cell has one of these attributes since, if only part of a cell is bold, for instance, the fontstyle for the whole cell will be null. However, looking at a cell with only part of it bolded and part of it underlined, I can't seem to detect this with something like this: with activecell.font If IsNull(.Name) Or IsNull(.FontStyle) Or IsNull(.Underline) Or IsNull(.Bold) Then DetectJ = True end with What am I doing wrong? Excel 2002. TIA, James |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detecting Null
Seemed to work for me. At least it worked as I expected.
-- Regards, Tom Ogilvy "Zone" wrote in message ups.com... I want to detect whether part of the text in a cell is bolded, underlined, or uses a special font. Rather than slow things down by looking at each character, I thought I could just detect whether any part of the text in the cell has one of these attributes since, if only part of a cell is bold, for instance, the fontstyle for the whole cell will be null. However, looking at a cell with only part of it bolded and part of it underlined, I can't seem to detect this with something like this: with activecell.font If IsNull(.Name) Or IsNull(.FontStyle) Or IsNull(.Underline) Or IsNull(.Bold) Then DetectJ = True end with What am I doing wrong? Excel 2002. TIA, James |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detecting Null
Thanks, Tom. Yes, it does work fine. I checked again and I didn't
have the cell address correct. I appreciate your answer. Forced me to find the mistake. This way is much faster than looking at each character. Regards, James Tom Ogilvy wrote: Seemed to work for me. At least it worked as I expected. -- Regards, Tom Ogilvy "Zone" wrote in message ups.com... I want to detect whether part of the text in a cell is bolded, underlined, or uses a special font. Rather than slow things down by looking at each character, I thought I could just detect whether any part of the text in the cell has one of these attributes since, if only part of a cell is bold, for instance, the fontstyle for the whole cell will be null. However, looking at a cell with only part of it bolded and part of it underlined, I can't seem to detect this with something like this: with activecell.font If IsNull(.Name) Or IsNull(.FontStyle) Or IsNull(.Underline) Or IsNull(.Bold) Then DetectJ = True end with What am I doing wrong? Excel 2002. TIA, James |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Failed to save table attributes of (null) into (null). | Excel Discussion (Misc queries) | |||
COUNTIF says Null = Blank but Blank < Null | Excel Worksheet Functions | |||
Null, "null", vbNull, vbNullString, vbEmpty | Excel Programming | |||
cell value based on null/not null in another cell | Excel Worksheet Functions | |||
Detecting VBA code | Excel Programming |