Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

STL - Formerly Best Training Solutions Through Learning
TrustPilot
Excellent
Request Callback We will call you back
0207 987 3777 Call for assistance
Your Basket Basket is empty
line and bar charts

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Line and bar charts with secondary axis

Line and bar charts with secondary axis

ResolvedVersion 2003

Katy has attended:
Excel VBA Advanced course

Line and bar charts with secondary axis

In VB what code do I need to create a chart with a secondary axis? Once created how then can I change the chart type for the data on the primary axis to a bar chart and the data on the secondary axis to a line chart?

RE: Line and bar charts with secondary axis

Hi Katy

Thankyou for your question

After some experimenting i have found the following code snippet which selects a series in a chart and then plots it against a secondary axis

ActiveChart.SeriesCollection(5).Select
ActiveChart.SeriesCollection(5).AxisGroup = 2


As you can see the series is identified by its index number in the collection and then sets the axisgroup property to 2

Hope this helps

Regards

Stephen

Wed 28 Jan 2009: Automatically marked as resolved.

Excel tip:

Jumping Across the Excel Screen

PgDn and PgUp keys scrolls up and down a screen page in most applications.

Alt+PgDn and Alt+PgUp is the equivalent across the spreadsheet.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.11 secs.