+ Reply to Thread
Results 1 to 3 of 3

creating charts using macros which picks up source data from the active sheet??

  1. #1
    Registered User
    Join Date
    07-26-2007
    Posts
    7

    creating charts using macros which picks up source data from the active sheet??

    Hi guys

    Really stuck here - i'm very new to using macros. I have a lot of data needing to be processed. I have 5 sheets of data per excel file and need a way of running a macro to create charts in each sheet using the source data from that worksheet.

    I can write the macro to create the chart but each time I run it on a new sheet it just uses the source data from the original sheet.

    Please help?!

  2. #2
    Registered User
    Join Date
    07-26-2007
    Posts
    7
    Ok, I found a way to use the active sheet for the source code using this:

    Sub Tprofiles()
    Dim NewChart As ChartObject
    Dim SourceRng As Range

    Set SourceRng = ActiveSheet.Range("A1:N800")
    Set NewChart = ActiveSheet.ChartObjects.Add(1000, 100, 400, 200)

    With NewChart.Chart
    .ChartType = xlXYScatterSmoothNoMarkers
    .SetSourceData SourceRng
    End With

    End Sub


    Is there a way of automating the chart generation across the sheets without having to run the macro for each sheet individually?

    Also - how do i put the chart and axis names into the macro?

    Help appreciated!

  3. #3
    Registered User
    Join Date
    07-05-2007
    Location
    Cincinnati, OH
    Posts
    44
    Please Login or Register  to view this content.
    That will let you name your chart and axes.

    perhaps you could post an example for help with the rest

+ Reply to Thread

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