Macro help

rp1989

New Member
Joined
Feb 28, 2011
Messages
2
Hey everyone,

I am trying to generate graphs from a data set. Column A is the title of graph. Columns B-F are y-axis values. Row 1, columb b-f are the titles for the x-axis. Every row after row 1 is suppose to be a new graph. All the graphs can be on the same excel file. Any ideas on how to run a macro to generate each graph rather than doing it manually. Thanks
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I think this is in line with what you are looking for.

Code:
Sub GenSingleSeriesChart()
Application.ScreenUpdating = False
LastRow = Range("A100").End(xlUp).Row
For rowidx = 2 To LastRow
Range("A1:F1,A" & rowidx & ":F" & rowidx).Select
ActiveSheet.Shapes.AddChart.Select
    ActiveChart.SetSourceData Source:=Range( _
        "'Sheet1'!$A$1:$F$1,'Sheet1'!$A" & rowidx & ":$F" & rowidx)
    ActiveChart.ChartType = xlLine
Next rowidx
Application.ScreenUpdating = True
Range("A1").Select
End Sub

Code:
Sub DelCharts()
For ShapeIdx = ActiveSheet.Shapes.Count To 1 Step -1
    ActiveSheet.Shapes(ShapeIdx).Delete
Next ShapeIdx
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,733
Members
452,939
Latest member
WCrawford

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