Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I loop through workbook and rename all chart titles?

I have a workbook with about 45 worksheets, each of which have 2
charts. When the workbook is opened I get a 4 character code from th
user via an InputBox. I'd like to take this code and prefix ever
chart title in the workbook with it.

Could someone post an example of the VBA code that I'd use t
dynamically loop through every worksheet/chart and append this to th
existing chart titles?

Thanks a lot. I'm familiar with VB but not familiar enough with Exce
objects to get this done in time.

BackPaddle

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I loop through workbook and rename all chart titles?

Here is the quick and dirty solution. I'm sure you can clean this up
bit, though. - Pikus

p = "PREF"
sheetCount = 45
For x = 1 To sheetCount
With Worksheets(x)
c = .ChartObjects.Count
For y = 1 To c
.ChartObjects(y).Chart.ChartTitle.Text = _
p & .ChartObjects(y).Chart.ChartTitle.Text
Next y
End With
Next

--
Message posted from http://www.ExcelForum.com

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
Change multiple Chart Titles in different sheets in the same Workbook asprivl Excel Worksheet Functions 2 November 24th 10 10:44 AM
How to open a new workbook and rename the workbook? pokdbz Excel Discussion (Misc queries) 3 December 26th 07 03:37 PM
Chart Titles not showing in excel chart Greg_tnwre Excel Discussion (Misc queries) 1 July 28th 06 05:36 PM
Chart Titles not showing in excel chart Window Greg_tnwre Excel Discussion (Misc queries) 0 July 15th 06 03:41 AM
Workbook, worksheet rename PW[_2_] Excel Programming 0 September 4th 03 12:34 PM


All times are GMT +1. The time now is 03:56 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"