View Single Post
 
Old 10-26-2014, 08:10 AM
p45cal's Avatar
p45cal p45cal is offline Windows 7 32bit Office 2010 32bit
Expert
 
Join Date: Apr 2014
Posts: 956
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Quote:
Originally Posted by whatsup View Post
Pocerus, what's the loop for?
Quite.
Is this what you're looking to do? (all subs rolled into 1):
Code:
Sub setDataChart()
Range("A1").Value = 1
Range("A1:A6").DataSeries
With ActiveSheet.Shapes.AddChart
  .Chart.ChartType = xlXYScatterSmoothNoMarkers
  .Height = 325
  .Width = 900
  .Top = 120
  .Left = 10
  Range("B1:FA6").Formula = "=RANDBETWEEN(0,10)"
  For i = 2 To 157
    .Chart.SetSourceData Source:=Union(Range("A1:A6"), Range("A1:FA6").Columns(i))
    Application.ScreenUpdating = True
    MsgBox "OK to continue…"
  Next i
End With
End Sub
Reply With Quote