Go Back   Access World Forums > Apps and Windows > Excel

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-07-2019, 02:29 AM   #1
SamuelDz
Newly Registered User
 
Join Date: Oct 2019
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
SamuelDz is on a distinguished road
Use VBA to change series legend labels in Datasheet

Helllo all,

Im trying to modify the series labels of a chart (in the datasheet) in access using VBA, I have successfully used it to modify the data in the range but i now want to change the labels.

Is this possible?
below is the code im using to modify the data.

Private Sub Command318_Click()
Dim Graph_Data As Object
Dim objDataSheet As Object

Set Graph_Data = Me!UnboundChart.Object
Set objDataSheet = Graph_Data.Application.DataSheet

objDataSheet.Range("A1").Value = 9


Image below shows what I want change with vba
Attached Images
File Type: jpg 111.JPG (36.8 KB, 9 views)

SamuelDz is offline   Reply With Quote
Old 10-07-2019, 02:31 AM   #2
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 10,350
Thanks: 112
Thanked 2,841 Times in 2,591 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: Use VBA to change series legend labels in Datasheet

Hi
For info, I moved this to the Excel forum.
Someone will I'm sure be along soon to assist
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 10-07-2019, 02:32 AM   #3
SamuelDz
Newly Registered User
 
Join Date: Oct 2019
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
SamuelDz is on a distinguished road
Re: Use VBA to change series legend labels in Datasheet

Hi Sorry this is Access related.

SamuelDz is offline   Reply With Quote
Old 10-07-2019, 03:21 AM   #4
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,385
Thanks: 68
Thanked 2,698 Times in 2,583 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Use VBA to change series legend labels in Datasheet

objDataSheet.Range("01") ="my Label 1"
objDataSheet.Range("02") ="my Label 2"
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
The Following User Says Thank You to arnelgp For This Useful Post:
SamuelDz (10-07-2019)
Old 10-07-2019, 06:13 AM   #5
SamuelDz
Newly Registered User
 
Join Date: Oct 2019
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
SamuelDz is on a distinguished road
Re: Use VBA to change series legend labels in Datasheet

Thanks worked perfectly (Y)

SamuelDz is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change legend colors andrewkoemm Reports 1 09-26-2015 11:57 AM
Form Pivot Chart legend labels show SUM degimp Forms 2 09-04-2014 01:29 PM
Programmably Change a Chart Legend Daveyk01 Reports 0 06-22-2010 11:59 AM
PivotChart series labels magically disappear fire2ice Forms 0 07-21-2008 05:09 AM
Chart Legend Labels rich.barry Forms 2 09-26-2006 01:39 AM




All times are GMT -8. The time now is 12:37 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World