Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 10th, 2006, 01:05 PM
Registered User
 
Join Date: Jul 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB code to title chart sheets individually

Okay...so can anyone help me with debugging my code.

I have a macro that generates charts on separate sheets and titles them according to the column name...however, i want the sheets (the little tabs) that are made with the charts on them to have labels that match the title of the chart.

this is what I have...there seems to be an error.

ActiveChart.Name = DataSheet.Cells(1, icolumn)


any assistance would be greatly appreciated. thanks guys! :)
 
Old October 18th, 2006, 09:16 PM
Registered User
 
Join Date: Oct 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

have you fixed this?

have you tried naming the sheet instead of attempting to name the chart

          worksheets("sheet1").ChartObjects(1).chart.name="b lah"
will give an error b/c chart.name is (almost) readonly in that
the .Name is derived from the SHEET name and the CHART name
i.e.
        debug.print worksheets("sheet1").ChartObjects(1).chart.name
will return
        Sheet1 Chart 2


          sheet1.Name="frog"
this will rename sheet1 to 'frog' just be sure to name the correct sheet. ActiveSheet.Name might work.



hth





Similar Threads
Thread Thread Starter Forum Replies Last Post
Websites content reading code like title of any we ali_ggl Javascript How-To 0 February 1st, 2008 08:58 AM
Excel VBA "Sheets(array(. . .))" code line hsheldon Excel VBA 5 June 6th, 2007 09:55 AM
Can I add code to title tags? wehaveasolution ASP.NET 1.0 and 1.1 Basics 0 October 10th, 2005 09:59 AM
Changing Crystal Report Title from VB Code Niaz Pro VB Databases 4 June 9th, 2004 09:51 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.