Watsup everyone,
I'm having 2 problems, both dealing with similar themes of having code work for all possible series/worksheets, so i'm wondering if there's a macro that deals with this:
1) I'd like to have the code I'm writing run for every worksheet in the workbook without having to manually change the sheetname "SPECIFIC WORKSHEET" each time or copy the same code 8 times with different sheetnames. how can i do this?
code example:
Charts.Add
ActiveChart.Cha rtType = xlLineMarkers
ActiveChart.Set SourceData Source:=Sheets( "SPECIFIC WORKSHEET").Ran ge("A1:L7"), _
PlotBy:=xlRows
ActiveChart.Loc ation Where:=xlLocati onAsNewSheet, Name:="SPECIFIC WORKSHEET Chart"
With ActiveChart
.HasTitle = True
.ChartTitle.Cha racters.Text = "BLAH BLAH SPECIFIC WORKSHEET"
End With
2) I'd like the changes within a chart I'm building in vba to apply to all of the series, not just series1 or series2, etc.
code example:
ActiveChart.Ser iesCollection(1 ).Select
With Selection.Borde r
.Weight = xlThick
End With
or
ActiveChart.Ser iesCollection(2 ).Select
With Selection.Borde r
.Weight = xlThick
End With
.....etc.
Any help would be much appreciated. I am new to vba, so if these answers are trivial I apologize.
thanks,
dave
I'm having 2 problems, both dealing with similar themes of having code work for all possible series/worksheets, so i'm wondering if there's a macro that deals with this:
1) I'd like to have the code I'm writing run for every worksheet in the workbook without having to manually change the sheetname "SPECIFIC WORKSHEET" each time or copy the same code 8 times with different sheetnames. how can i do this?
code example:
Charts.Add
ActiveChart.Cha rtType = xlLineMarkers
ActiveChart.Set SourceData Source:=Sheets( "SPECIFIC WORKSHEET").Ran ge("A1:L7"), _
PlotBy:=xlRows
ActiveChart.Loc ation Where:=xlLocati onAsNewSheet, Name:="SPECIFIC WORKSHEET Chart"
With ActiveChart
.HasTitle = True
.ChartTitle.Cha racters.Text = "BLAH BLAH SPECIFIC WORKSHEET"
End With
2) I'd like the changes within a chart I'm building in vba to apply to all of the series, not just series1 or series2, etc.
code example:
ActiveChart.Ser iesCollection(1 ).Select
With Selection.Borde r
.Weight = xlThick
End With
or
ActiveChart.Ser iesCollection(2 ).Select
With Selection.Borde r
.Weight = xlThick
End With
.....etc.
Any help would be much appreciated. I am new to vba, so if these answers are trivial I apologize.
thanks,
dave
Comment