Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
Leo Leo is offline
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 2,489
Default 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
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
Hyperion Essbase Excel Add-in - returning text ("0") for null valu bill_morgan Excel Discussion (Misc queries) 7 February 28th 12 05:10 AM
How do I set the default font size in the "comment" feature? Steve Excel Discussion (Misc queries) 1 November 4th 06 12:49 AM
"SHEET TAB FONT SIZE"? leesmile Excel Worksheet Functions 4 October 14th 06 12:36 AM
very large font size when using "help" menu joel Excel Discussion (Misc queries) 0 May 23rd 06 03:56 PM
cells formatted to tick when text value "Y" if or null if "N" Jay Excel Discussion (Misc queries) 7 January 13th 06 09:16 AM


All times are GMT +1. The time now is 10:02 PM.

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"