Chart Macro

danjw_98

Active Member
Joined
Oct 25, 2003
Messages
354
I was trying to create a graph with data from column "b, c" and Columns " f thru m" using the below macro. It captures data from columns b thru m, i don't want the data from columns "d and e" in the graph. any help would be appreciated...

Application.ScreenUpdating = False
Sheets("sheet1").Select
finalrow = Range("b65536").End(xlUp).Row
val1 = finalrow

ActiveSheet.Shapes.AddChart.Select
ActiveChart.SetSourceData Source:=Sheets("sheet1").Range("b1:c" & val1, "f1:m" & val1)
ActiveChart.ChartType = xl3DColumnClustered
ActiveChart.ClearToMatchStyle
ActiveChart.ChartStyle = 42
ActiveChart.ClearToMatchStyle
ActiveChart.ApplyLayout (5)

ActiveChart.ChartTitle.Text = "Test"
ActiveChart.SetElement (msoElementPrimaryCategoryGridLinesMajor)
ActiveChart.RightAngleAxes = False
ActiveChart.Perspective = 70
ActiveChart.HasAxis(xlCategory, xlPrimary) = False

ActiveChart.Elevation = 0 'rotation of the z-axis
ActiveChart.Rotation = 0 'rotation about the z-axis
With ActiveChart.Parent
.Height = 600 ' resize
.Width = 800 ' resize
.Top = 200 ' reposition
.Left = 20 ' reposition
End With
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,224,613
Messages
6,179,903
Members
452,948
Latest member
Dupuhini

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