Hello,
I have an excel lookup table which generates graph for specific piping case. I am looking to put in a loop to run all 480 cases and generate there corresponding graphs on seperate sheets.
For count = 0 To 479
If Sheets("Data").Range("B3").Offset(count, 0).Text = strFeeder Then
'Delete Old Sheet
If Sheets("Data").Range("CP3").Offset(count, 0).Value = -1 Then
Sheets(label).Delete
End If
Sheets("Data").Range("CE3:CV3").Offset(count, 0) = " "
'Plot scatter plot as new sheet
Charts.Add
ActiveChart.ChartType = xlXYScatter
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Values = "=(Data!R" & CStr(count + 3) & "C81,Data!R" _
& CStr(count + 3) & "C72,Data!R" _
& CStr(count + 3) & "C63,Data!R" _
& CStr(count + 3) & "C54,Data!R" _
& CStr(count + 3) & "C45,Data!R" _
& CStr(count + 3) & "C36,Data!R" _
& CStr(count + 3) & "C27,Data!R" _
& CStr(count + 3) & "C18,Data!R" _
& CStr(count + 3) & "C9)"
If Sheets("Data").Range("D3").Offset(count, 0).Value = 2 Then
ActiveChart.SeriesCollection(1).XValues = "={2.44,2.83,3.21,3.6,3.99,4.38,4.76,5.15,5.54}"
Else
ActiveChart.SeriesCollection(1).XValues = "={3.15,3.63,4.12,4.6,5.08,5.56,6.05,6.53,7.01}"
End If
ActiveChart.Location Where:=xlLocationAsNewSheet, Name:=label
Can anyone help me put in a loop to run all 480 cases.
Regards,
Umair
Bookmarks