charts and macros
Prep for a pre-employment Excel test with Job Test Prep
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: charts and macros

  1. #1
    Guest

    Default

     
    I have a very long spreadsheet and I would like to make a separate chart for each line of the sheet. is it possible to create a macro to generate charts?

    Thanks
    JAS

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try this macro, not fully tested. Got most of the code from the Macro recorder.

    Code:
    Sub Macro1()
    Dim i As Long
    
    For i = 2 To Range("A65536").End(xlUp).Row
        Charts.Add
        ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A" & i & ":E" & i)
        ActiveChart.Location Where:=xlLocationAsNewSheet 'xlLocationAsObject
        Sheets("Sheet1").Select
    Next i
    End Sub
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  3. #3
    Guest

    Default

      
    Thank you Mr Excel, it worked!

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com