Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default looping through text boxes

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default looping through text boxes

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
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
Default font for pasted text in text boxes - Excel 2007 MS OFFICE USER EIT Excel Discussion (Misc queries) 0 March 25th 10 09:01 PM
User Form Text Boxes - Copy format of text boxes NDBC Excel Discussion (Misc queries) 3 July 2nd 09 02:02 AM
How do I link Text Boxes to Cells, not Cells to Text Boxes? Ebby Excel Worksheet Functions 1 May 15th 07 11:31 PM
building a text string while looping though a worksheet Phillips Excel Programming 4 December 10th 03 08:31 AM
Looping through Text boxes Fred[_9_] Excel Programming 0 July 9th 03 03:06 AM


All times are GMT +1. The time now is 11:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"