+ Reply to Thread
Results 1 to 6 of 6

Help needed to loop a macro and create many charts through a data range

  1. #1
    Registered User
    Join Date
    10-20-2018
    Location
    Scotland
    MS-Off Ver
    2013
    Posts
    3

    Help needed to loop a macro and create many charts through a data range

    Hi there, brand new to forum and just learning VBA.

    I have a table of data, over 100 entries, each needing a separate chart. I have recorded a macro which does the following

    Selects my chart
    changes its name
    changes the row values it references
    copies to cell on the sheet, 16 rows down.

    I have done it in the macro for 3 repetitions but can someone guide me how to loop for 100 repetitions but also increment the chart name and reference data?

    Please Login or Register  to view this content.


    Thanks in advance

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Help needed to loop a macro and create many charts through a data range

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    10-20-2018
    Location
    Scotland
    MS-Off Ver
    2013
    Posts
    3

    Re: Help needed to loop a macro and create many charts through a data range

    Hi Mehmetcik, pasting that directly into the editor returns error on line " Range("B" & 3 + (Count - 1) * 16).Paste"

    to be honest, i dont know what its doing, could you comment on what the code does?

    Thanks

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Help needed to loop a macro and create many charts through a data range

    Hmm I would have thought that would work.

    Try this instead:-

    Please Login or Register  to view this content.


    When Count = 2
    Please Login or Register  to view this content.
    Means

    Please Login or Register  to view this content.
    When Count = 3

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 10-20-2018 at 06:04 PM.

  5. #5
    Registered User
    Join Date
    10-20-2018
    Location
    Scotland
    MS-Off Ver
    2013
    Posts
    3

    Re: Help needed to loop a macro and create many charts through a data range

    Hi Mehmetcik,
    I'm afraid I am at a loss. I have attached the data set and graph. the code still returns an error. I would be grateful if you could look at it and comment. Can you also point out where it goes wrong so that i can learn

    Thank you very much
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Help needed to loop a macro and create many charts through a data range

    Please Go back to Your First Post.

    Please attach the workbook that your two repetition macro worked in.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How do I create interactive charts based on different range of data?
    By Byambadorj in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 01-08-2018, 08:19 PM
  2. How do I create interactive charts based on different range of data?
    By Byambadorj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-08-2018, 08:12 PM
  3. Replies: 2
    Last Post: 01-08-2018, 08:10 PM
  4. [SOLVED] Macro to loop throug the workbook and create charts
    By dobracik in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 03-23-2015, 03:27 PM
  5. [SOLVED] Macro to loop through the sheet and create Line charts
    By dobracik in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-23-2015, 01:11 PM
  6. [SOLVED] loop macro to create different charts by selecting different x-axis data
    By burnmeister in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-01-2013, 10:38 AM
  7. Macro needed for multiple series of data to plot unique charts
    By ehelliar in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 04-23-2011, 11:50 AM

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