Visual Basic for Applications (VBA)


Adding text labels to points on a chart.


I have a working chart in Excel 2016. I want to add a text label to each point on the chart.
This method gives labels at each point but there are many labels printed at the same spot:
Sheets("Analysis").ChartObjects("Chart 1").Chart.SeriesCollection(s).ApplyDataLabels
Sheets("Analysis").ChartObjects("Chart 1").Chart.SeriesCollection(s).DataLabels
This method gives "Object" error
Sheets("Analysis").ChartObjects("Chart 1").Chart.SeriesCollection(s).ShowSeriesName = True
Sheets("Analysis").ChartObjects("Chart 1").Chart.SeriesCollection(s).DataLabels.AutoText = True
This also gives an error:
Sheets("Analysis").ChartObjects("Chart 1").Chart.SeriesCollection(s).Points(s).DataLabels.HasDataLabel = True
Sheets("Analysis").ChartObjects("Chart 1").Chart.SeriesCollection(s).Points(s).DataLabel.Position = xlLabelPositionBelow
Sheets("Analysis").ChartObjects("Chart 1").Chart.SeriesCollection(s).Points(s).DataLabel.Text = nameA(s)

Related Links

Changing text colour of fields from recordset in MS Word
Running Code in a shared workbook
Range.Find method and Dates
Navigate and Set multiple HTMLDocument objects with Loops
Tree View Active X help files missing
Macro to read GUI Application
How to fill in blank cells with correct data without overwriting the data above it?
rch for date and return other fields
How to paste clipboard content to a folder (as a file)
Copy Outlook Message body content into MS Excel
extract a CAB file with VBA
OMG my project has crashed
Assigning Range of Cells to Array
Create Code to Update Value in Record From Previous Data Record
MSComm -Having problem receiving data from modem
Exporting Microsoft Word Review Comments to Microsoft Excel - Error 91 ??

Categories

MSDN
SharePoint
Visual Studio Design a...
Architecture
Internet Explorer Deve...
SQL Server
Bing
Unified Communications
Windows Phone Preview ...
Open source Developmen...
Visual C#
C++ Standards, Extensi...
Visual Studio Unit Tes...
Application Insights (AI)
Publishing Windows Sto...
Payouts and Reporting
Application Compatibil...
Developing Windows Des...
DirectShow Development
Microsoft Message Queu...
Windows Desktop Pro-Au...
Open XML Format SDK
SharePoint 2010 - Deve...
Workflow Manager 1.0
Azure SQL Database
Pricing & Billing
Azure BizTalk Services
Azure App Service - We...
Azure Search
Azure SQL Data Warehouse
Azure Data Catalog
Azure IoT Hub
Azure Functions
Azure Database for Pos...
Azure Database for MySQL
Windows Presentation F...
Team Foundation Server...
Team Foundation Server...
BizTalk Server General
BizTalk ESB Toolkit
Microsoft Robotics - S...
.NET Compact Framework
SQL Server SMO/DMO
SQL Server Setup & Upg...
Microsoft StreamInsight
Database Design
Standard 7: Components...
Standard 7: Tools
Windows Embedded Compa...
SQL Server 2012 Integr...
ClickOnce and Setup & ...
Live Connect (Archived)
CRM Development
Dynamics 365 for Custo...
Orchard –Discussions
WebsitePanel - Enterpr...
Bing Maps WPF, WP7/8/8...
Office Live Basics, Es...
Office XML, ODF, and B...
Microsoft Atlas APIs: ...
Microsoft Lync Server ...
Silverlight 5
Hosting and Streaming ...
MVVM / ViewModel Patte...
Silverlight Video and ...
Expression Blend + Ske...
Expression Studio
Expression Media
Microsoft Online Syndi...
Search Server: Install...
Retired InfoPath Forms...
Retired SharePoint Acc...
.NET Framework 4 Relea...
ADO.NET Entity Framewo...
Announcements about pr...
Architecture, Tools, a...
Azure Troubleshooting,...
Azure Startups
Developer Documentatio...
HD DVD Interactivity A...
Innovate on Office
Monitor, Alert and Aut...
Parallel Computing Gen...
Oracle on Azure
Search Server: Develop...
Search Server: Feature...
SyncFx - Microsoft Syn...
SQL Server 2014 Data Q...
SQL Server 2014 Self-S...
SQL Server 2014 Report...
TFS Deployment to Azure
Tools for Windows Stor...
Tailoring your Windows...
Visual Basic Express E...
Visual Basic Language
Visual C++ Express Edi...
Visual C++ MFC and ATL
Visual Studio 2008 SP1...
Visual Studio Guidance...
Visual Studio Team Sys...
Visual Studio UI Autom...
Windows Live Search: D...
Windows Presentation F...
Windows SideShow Devel...
XNA Framework
Microsoft Graph

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile