Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.charting
|
|||
|
|||
VBA returning "Null" for TextBox.Font.Size
Dear all;
I was wondering if anyone knows of a workaround to the following issue. I have a chart with a few textboxes. If I ask Dim tb As TextBox For Each tb In ActiveChart.TextBoxes Debug.Print tb.Name, tb.Font.Size Next I get Text Box 2054 8 Text Box 2061 Null Text Box 2062 8 Text Box 2063 8 Text Box 2064 8 Text Box 2067 8 My problem is box 2061, which returns "Null" (!)... I can see that the box has a nice "9" font size value in the chart itself, though. Any ideas? I'm using Excel 2003 (11.6355.6360) SP 1 Thanks, Leo |
#2
Posted to microsoft.public.excel.charting
|
|||
|
|||
VBA returning "Null" for TextBox.Font.Size
Hi,
That would suggest that the textbox contains mixed font sizes. Try this routine. Sub x() Dim sngFSize As Single Dim lngIndex As Long Dim tb As TextBox For Each tb In ActiveChart.TextBoxes If IsNull(tb.Font.Size) Then sngFSize = 0 Debug.Print "Mixed Font ", tb.Name, "Sizes "; For lngIndex = 1 To Len(tb.Text) If tb.Characters(lngIndex, 1).Font.Size < sngFSize Then sngFSize = tb.Characters(lngIndex, 1).Font.Size Debug.Print ","; sngFSize; End If Next Debug.Print Else Debug.Print tb.Name, tb.Font.Size End If Next End Sub Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "Leo" wrote in message ... Dear all; I was wondering if anyone knows of a workaround to the following issue. I have a chart with a few textboxes. If I ask Dim tb As TextBox For Each tb In ActiveChart.TextBoxes Debug.Print tb.Name, tb.Font.Size Next I get Text Box 2054 8 Text Box 2061 Null Text Box 2062 8 Text Box 2063 8 Text Box 2064 8 Text Box 2067 8 My problem is box 2061, which returns "Null" (!)... I can see that the box has a nice "9" font size value in the chart itself, though. Any ideas? I'm using Excel 2003 (11.6355.6360) SP 1 Thanks, Leo |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hyperion Essbase Excel Add-in - returning text ("0") for null valu | Excel Discussion (Misc queries) | |||
How do I set the default font size in the "comment" feature? | Excel Discussion (Misc queries) | |||
"SHEET TAB FONT SIZE"? | Excel Worksheet Functions | |||
very large font size when using "help" menu | Excel Discussion (Misc queries) | |||
cells formatted to tick when text value "Y" if or null if "N" | Excel Discussion (Misc queries) |