Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all
I have a chart sheet that I have put several textboxes onto all linked to various variables. At the moments I am using this code for each instance With ActiveChart.TextBoxes.Add(45, 90, 150, 20) .Select .Text = "Well: " & Well_Name End With With Selection.Characters(Start:=1, Length:=30).Font .Name = "times new roman" .FontStyle = "Regular" .Size = 12 End With How can I loop through all the textboxes once they have been created and change the font and size. I think its somthing along the lines of for each Textbox in activechart FORMAT next textbox Im trying this in several versions but always end up with "Object doesnt support this property or method" how should I be referencing each textbox Cheers Ian |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ian
Try the code below. You will have to change the name of the chart accordingly. Tony ActiveSheet.ChartObjects("Chart 3").Activate For Each te In ActiveChart.TextBoxes With te.Font .Name = "times new roman" .FontStyle = "regular" .Size = 15 End With Next te ----- Ian Mangelsdorf wrote: ----- Hi all I have a chart sheet that I have put several textboxes onto all linked to various variables. At the moments I am using this code for each instance With ActiveChart.TextBoxes.Add(45, 90, 150, 20) .Select .Text = "Well: " & Well_Name End With With Selection.Characters(Start:=1, Length:=30).Font .Name = "times new roman" .FontStyle = "Regular" .Size = 12 End With How can I loop through all the textboxes once they have been created and change the font and size. I think its somthing along the lines of for each Textbox in activechart FORMAT next textbox Im trying this in several versions but always end up with "Object doesnt support this property or method" how should I be referencing each textbox Cheers Ian |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Default font for pasted text in text boxes - Excel 2007 | Excel Discussion (Misc queries) | |||
User Form Text Boxes - Copy format of text boxes | Excel Discussion (Misc queries) | |||
How do I link Text Boxes to Cells, not Cells to Text Boxes? | Excel Worksheet Functions | |||
building a text string while looping though a worksheet | Excel Programming | |||
Looping through Text boxes | Excel Programming |