Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

For Each...Next Loop with Worksheets

Status
Not open for further replies.

WAR40K

Technical User
Oct 29, 2003
29
US
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
 
Disregard

Figured it out at the 11th hour.

thx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top