Results 1 to 3 of 3

Thread: Multiple Charts

Threaded View

  1. #2
    Fanatic Member VBAhack's Avatar
    Join Date
    Dec 2004
    Location
    Sector 000
    Posts
    617

    Re: Multiple Charts

    Welcome to the forums.

    I ran the following small scale prototype of what you are doing and it works ok. There are 12 rows of data (rows 1-12) and 6 columns (A-F). Each plot contains 3 rows of data for a total of 4 charts.

    VB Code:
    1. Sub ChartTest()
    2.     Dim aaaRow As Integer, bbbRow As Integer, incr As Integer, myLastRow As Integer
    3.     Dim myRange As String
    4.     incr = 2
    5.     aaaRow = 0
    6.     bbbRow = 0
    7.     myLastRow = 10
    8.    
    9.     While aaaRow < myLastRow
    10.         aaaRow = bbbRow + 1
    11.         bbbRow = aaaRow + incr
    12.         myRange = "A" & aaaRow & ":F" & bbbRow
    13.         Charts.Add
    14.         With ActiveChart
    15.             .ChartType = xlXYScatterSmooth
    16.             .SetSourceData Source:=Sheets("Sheet1").Range(myRange)
    17.             .Location Where:=xlLocationAsObject, Name:="Sheet1"
    18.         End With
    19.     Wend
    20. End Sub
    Last edited by VBAhack; Jul 17th, 2006 at 03:48 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width