Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-26-2014, 08:10 AM
p45cal's Avatar
p45cal p45cal is offline Excel 2010 Chart SetSourceData 1004 error Windows 7 32bit Excel 2010 Chart SetSourceData 1004 error 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
Reply

Tags
seriescollection, setsourcedata, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Time Error '1004' galkej Excel 0 02-03-2014 06:39 AM
Excel 2010 Chart SetSourceData 1004 error Run-time error '1004': Document not saved. The document may be open... doctor_who12 Excel Programming 1 01-22-2014 04:47 PM
paste fails error 1004 in VBA Excel 2010 mikec Excel Programming 17 05-08-2013 03:11 PM
Excel 2010 Chart SetSourceData 1004 error Run time error 1004 yonasan Excel Programming 3 06-12-2012 11:08 PM
Excel 2010 Chart SetSourceData 1004 error runtime error 1004 gbaker Excel Programming 11 06-06-2012 05:23 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:19 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft