ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   Help (https://www.excelbanter.com/charts-charting-excel/448936-help.html)

[email protected]

Help
 
Not sure what i'm doing wrong but it wont graph it correctly.

Sub Graph()
'
' Graph Macro
'

'
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlColumnClustered
With ActiveSheet.Shapes(1).Fill
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorAccent1
.ForeColor.TintAndShade = 0.3399999738
.ForeColor.Brightness = 0
.BackColor.ObjectThemeColor = msoThemeColorAccent1
.BackColor.TintAndShade = 0.7649999857
.BackColor.Brightness = 0
.TwoColorGradient msoGradientHorizontal, 1
End With
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "=Trend!$D$4"
ActiveChart.SeriesCollection(1).Values = "=Trend!$F$4:$Q$4"
ActiveChart.SeriesCollection(1).XValues = "=Trend!$F$3:$Q$3"
ActiveChart.Legend.Select
Selection.Delete
ActiveSheet.ChartObjects(1).Activate
ActiveChart.SeriesCollection(1).Select
With Selection.Format.ThreeD
.BevelTopType = msoBevelCircle
.BevelTopInset = 6
.BevelTopDepth = 6
End With
With Selection.Format.ThreeD
.BevelBottomType = msoBevelCircle
.BevelBottomInset = 6
.BevelBottomDepth = 6
End With
ActiveChart.ChartArea.Select
With ActiveSheet.Shapes(1).ThreeD
.BevelTopType = msoBevelCircle
.BevelTopInset = 6
.BevelTopDepth = 6
End With
With ActiveSheet.Shapes(1).ThreeD
.BevelBottomType = msoBevelCircle
.BevelBottomInset = 6
.BevelBottomDepth = 6
End With
Range("G2").Select
End Sub

osuejm1026

Quote:

Originally Posted by (Post 1612524)
Not sure what i'm doing wrong but it wont graph it correctly.

Sub Graph()
'
' Graph Macro
'

'
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlColumnClustered
With ActiveSheet.Shapes(1).Fill
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorAccent1
.ForeColor.TintAndShade = 0.3399999738
.ForeColor.Brightness = 0
.BackColor.ObjectThemeColor = msoThemeColorAccent1
.BackColor.TintAndShade = 0.7649999857
.BackColor.Brightness = 0
.TwoColorGradient msoGradientHorizontal, 1
End With
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "=Trend!$D$4"
ActiveChart.SeriesCollection(1).Values = "=Trend!$F$4:$Q$4"
ActiveChart.SeriesCollection(1).XValues = "=Trend!$F$3:$Q$3"
ActiveChart.Legend.Select
Selection.Delete
ActiveSheet.ChartObjects(1).Activate
ActiveChart.SeriesCollection(1).Select
With Selection.Format.ThreeD
.BevelTopType = msoBevelCircle
.BevelTopInset = 6
.BevelTopDepth = 6
End With
With Selection.Format.ThreeD
.BevelBottomType = msoBevelCircle
.BevelBottomInset = 6
.BevelBottomDepth = 6
End With
ActiveChart.ChartArea.Select
With ActiveSheet.Shapes(1).ThreeD
.BevelTopType = msoBevelCircle
.BevelTopInset = 6
.BevelTopDepth = 6
End With
With ActiveSheet.Shapes(1).ThreeD
.BevelBottomType = msoBevelCircle
.BevelBottomInset = 6
.BevelBottomDepth = 6
End With
Range("G2").Select
End Sub

This code does not make any sense without some context. Tell us what your trying to do and maybe we can help you figure it out.


All times are GMT +1. The time now is 09:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com