Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I figured out how to change the text in a chart shape. However, my procedure
fails if there are any shapes on my chart that do not have any text. I tried several ways around this, but they all gave me a runtime error. Here's an example: For Each Shp In Cht.Shapes If (Shp.TextFrame.Characters.Text < "") Then Shp.TextFrame.Characters.Text = _ WorksheetFunction.Substitute _ (Shp.TextFrame.Characters.Text, Str1, Str2) End If Next Shp I also tried "If(Shp.TextFrame Is Nothing) Then" Can someone help? Thanks very much. Jamie |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Error Resume Next
For Each Shp In Cht.Shapes If (Shp.TextFrame.Characters.Text < "") Then Shp.TextFrame.Characters.Text = _ WorksheetFunction.Substitute _ (Shp.TextFrame.Characters.Text, Str1, Str2) End If Next Shp On Error goto 0 -- Regards, Tom Ogilvy Jamie Martin wrote in message ... I figured out how to change the text in a chart shape. However, my procedure fails if there are any shapes on my chart that do not have any text. I tried several ways around this, but they all gave me a runtime error. Here's an example: For Each Shp In Cht.Shapes If (Shp.TextFrame.Characters.Text < "") Then Shp.TextFrame.Characters.Text = _ WorksheetFunction.Substitute _ (Shp.TextFrame.Characters.Text, Str1, Str2) End If Next Shp I also tried "If(Shp.TextFrame Is Nothing) Then" Can someone help? Thanks very much. Jamie |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 Macro/VB Question DDE Question | Excel Worksheet Functions | |||
IF question | Excel Discussion (Misc queries) | |||
where can I see my question and answer? Yesterday I ask a question | Excel Discussion (Misc queries) | |||
Newbie Question - Subtraction Formula Question | Excel Discussion (Misc queries) | |||
The question is an excel question that I need to figure out howto do in excel. | Excel Worksheet Functions |