xgary.wilsonx

New Member
Joined
Dec 17, 2009
Messages
40
Please help - very new to posting for help so please be gentle

I wish to have a macro button that will create a graph from a table of data, however i want to be able to specify which columns and rows of data the macro will use to create it. I was going to record a macro (basic i know) that will copy an existing graph (for format etc) then amend the source data, legend etc. However i have no idea how to get the macro to only select the columns i want and all the populated rows below it.

Is this possible?

and if so how can i do this?

example of table

All Graph2 Graph1 Graph2 Graph1

Name Basic Word Excel Access SQL
Mike 4 4 5 6 2
Gary 6 5 3 2 2
Peter 5 3 2 1 5
David 5 5 5 4 4

Where graph one will be created showing column chart for only excel and SQL.

Please help, many thanks in advance



Gary
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I did the "record macro" method, and here's the code lines for adding a series from a specific range of cells, J22:J26 in this case, with G23:G26 holding the employee names:
Code:
    ActiveChart.SeriesCollection.NewSeries
    ActiveChart.SeriesCollection(1).XValues = "=Sheet1!R23C7:R26C7"
    ActiveChart.SeriesCollection(1).Values = "=Sheet1!R23C10:R26C10"
    ActiveChart.SeriesCollection(1).Name = "=Sheet1!R22C10"
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top