I need help with a loop.
I have a workbook with 13 worksheets. I want to paste the same information into the same range on each worksheet. In order to keep the workbook flexible should I add more worksheets in the future I just wanted to use a For each loop. However, with my code I keep getting a "Property not supported by this object". Can someone point me in the right direction?
By the way, I am using Microsoft Excel 2000. The VB Code is listed below.
i = 3
For Each Worksheet In ThisWorkbook
Worksheets(i).Select
quality = Range("C5"
.Value
delivery = Range("C6"
.Value
ActiveSheet.ChartObjects("Chart 1"
.Activate
ActiveChart.SeriesCollection(1).Select
With Selection.Interior
If delivery = 4 Then
.ColorIndex = 4
.Pattern = xlSolid
Else
If (delivery = 3) Or (delivery = 2) Then
.ColorIndex = 6
.Pattern = xlSolid
Else
.ColorIndex = 3
.Pattern = xlSolid
End If
End If
End With
ActiveChart.SeriesCollection(2).Select
With Selection.Interior
If quality = 4 Then
.ColorIndex = 4
.Pattern = xlSolid
Else
If (quality = 2) Or (quality = 3) Then
.ColorIndex = 6
.Pattern = xlSolid
Else
.ColorIndex = 3
.Pattern = xlSolid
End If
End If
End With
ActiveChart.ChartArea.Select
ActiveWindow.Visible = False
i = i + 1
Next worksheet
Thanks
I have a workbook with 13 worksheets. I want to paste the same information into the same range on each worksheet. In order to keep the workbook flexible should I add more worksheets in the future I just wanted to use a For each loop. However, with my code I keep getting a "Property not supported by this object". Can someone point me in the right direction?
By the way, I am using Microsoft Excel 2000. The VB Code is listed below.
i = 3
For Each Worksheet In ThisWorkbook
Worksheets(i).Select
quality = Range("C5"
delivery = Range("C6"
ActiveSheet.ChartObjects("Chart 1"
ActiveChart.SeriesCollection(1).Select
With Selection.Interior
If delivery = 4 Then
.ColorIndex = 4
.Pattern = xlSolid
Else
If (delivery = 3) Or (delivery = 2) Then
.ColorIndex = 6
.Pattern = xlSolid
Else
.ColorIndex = 3
.Pattern = xlSolid
End If
End If
End With
ActiveChart.SeriesCollection(2).Select
With Selection.Interior
If quality = 4 Then
.ColorIndex = 4
.Pattern = xlSolid
Else
If (quality = 2) Or (quality = 3) Then
.ColorIndex = 6
.Pattern = xlSolid
Else
.ColorIndex = 3
.Pattern = xlSolid
End If
End If
End With
ActiveChart.ChartArea.Select
ActiveWindow.Visible = False
i = i + 1
Next worksheet
Thanks