Hey guys keep getting an error msg of object variable or with block variable not set..excel highlighted the string of code that may be giving me the issue I a completely stumped need help!
the code is below..any help is appreciated
Sub Macro5()
'
' Macro5 Macro
'
' Keyboard Shortcut: Ctrl+e
'
Dim cht As ChartObject
For Each cht In Worksheets(1).ChartObjects
Next cht
cht.Chart.ChartType = xlPie
Range("D29:N29").Select
ActiveChart.SetSourceData Source:=Range("Sheet1!$D$29:$N$39")
ActiveSheet.Shapes("Chart 1").IncrementLeft 225
ActiveSheet.Shapes("Chart 1").IncrementTop -189
ActiveSheet.Shapes("Chart 1").ScaleWidth 0.9354166667, msoFalse, _
msoScaleFromBottomRight
ActiveSheet.Shapes("Chart 1").ScaleHeight 0.8993055556, msoFalse, _
msoScaleFromTopLeft
ActiveChart.SetSourceData Source:=Range( _
"Sheet1!$D$29:$N$29,Sheet1!$D$39:$N$39")
Range("O8").Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.FullSeriesCollection(1).Select
End Sub
the code is below..any help is appreciated
Sub Macro5()
'
' Macro5 Macro
'
' Keyboard Shortcut: Ctrl+e
'
Dim cht As ChartObject
For Each cht In Worksheets(1).ChartObjects
Next cht
cht.Chart.ChartType = xlPie
Range("D29:N29").Select
ActiveChart.SetSourceData Source:=Range("Sheet1!$D$29:$N$39")
ActiveSheet.Shapes("Chart 1").IncrementLeft 225
ActiveSheet.Shapes("Chart 1").IncrementTop -189
ActiveSheet.Shapes("Chart 1").ScaleWidth 0.9354166667, msoFalse, _
msoScaleFromBottomRight
ActiveSheet.Shapes("Chart 1").ScaleHeight 0.8993055556, msoFalse, _
msoScaleFromTopLeft
ActiveChart.SetSourceData Source:=Range( _
"Sheet1!$D$29:$N$29,Sheet1!$D$39:$N$39")
Range("O8").Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.FullSeriesCollection(1).Select
End Sub