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
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