Results 1 to 8 of 8

Var use

Threaded View

  1. #1
    Registered User
    Join Date
    07-29-2012
    Location
    Israel
    MS-Off Ver
    Excel 2003
    Posts
    4

    Var use

    Hi all

    This part of my code does not work, probably wrong use of vars i and j.
    Raw 15 of the code " ActiveChart.SeriesCollection(1).XValues = "='S2p Scan'!$A$i:$A$j" " is the problematic one.

    thx



     i = 17
     Do While True
     
      If Cells(i, 5) > 0 Then Exit Do
      i = i + 1
     
     Loop
     j = i
     Do While True
     
      If Cells(j, 5) = 0 Then Exit Do
      j = j + 1
     
     Loop
     j = j - 1
     
    
        ActiveSheet.Shapes.AddChart.Select
        ActiveChart.ChartType = xlXYScatterSmoothNoMarkers
        ActiveChart.SeriesCollection.NewSeries
        ActiveChart.SeriesCollection(1).XValues = "='S2p Scan'!$A$i:$A$j"
        ActiveChart.SeriesCollection(1).Values = "='S2p Scan'!$D$i:$D$j"
        ActiveChart.SeriesCollection.NewSeries
        ActiveChart.SeriesCollection(2).XValues = "='S2p Scan'!$A$i:$A$j"
        ActiveChart.SeriesCollection(2).Values = "='S2p Scan'!$F$i:$F$j"
        ActiveChart.SeriesCollection.NewSeries
        ActiveChart.SeriesCollection(3).XValues = "='S2p Scan'!$A$i:$A$j"
        ActiveChart.SeriesCollection(3).Values = "='S2p Scan'!$H$i:$H$j"
        ActiveChart.SeriesCollection.NewSeries
        ActiveChart.SeriesCollection(4).XValues = "='S2p Scan'!$A$i:$A$j"
        ActiveChart.SeriesCollection(4).Values = "='S2p Scan'!$J$i:$J$j"
        ActiveChart.SeriesCollection.NewSeries
        ActiveChart.SeriesCollection(5).XValues = "='S2p Scan'!$A$i:$A$j"
        ActiveChart.SeriesCollection(5).Values = "='S2p Scan'!$L$i:$L$j"
        ActiveChart.SeriesCollection.NewSeries
        ActiveChart.SeriesCollection(6).XValues = "='S2p Scan'!$A$i:$A$j"
        ActiveChart.SeriesCollection(6).Values = "='S2p Scan'!$P$i:$P$j"
    Last edited by Cutter; 07-29-2012 at 09:24 PM. Reason: Added code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1