+ Reply to Thread
Results 1 to 4 of 4

Looping through sheets and creating charts issue

  1. #1
    Registered User
    Join Date
    06-18-2014
    Location
    usa
    MS-Off Ver
    2010
    Posts
    2

    Question Looping through sheets and creating charts issue

    Hello folks,

    I have following code which is not behaving the way I want.
    Please Login or Register  to view this content.
    The problem is the last statement, a chart which gets created in an iteration does not "move" to a new sheet but rather same sheet. So end result is a sheet with chart of the last iteration.

    How to get this code to create new charts in new sheet and not the same sheet. A help will be greatly appreciated.
    Last edited by vlady; 06-19-2014 at 01:20 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Looping through sheets and creating charts issue

    Not really clear from your description what you want.

    Why not try recording the code and then replacing the last biit with correct syntax.

    You probably want to loop through Worksheets rather than Sheets, as sheets includes chartsheets which will not have ranges on it.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Looping through sheets and creating charts issue

    I just tried something and it seems to work fine for me (1 new sheet for each chart) but only after I change ThisWorkbook to ActiveWorkbook.

    This was what I did:
    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

  4. #4
    Registered User
    Join Date
    06-18-2014
    Location
    usa
    MS-Off Ver
    2010
    Posts
    2

    Re: Looping through sheets and creating charts issue

    Thanks so much Millz. That worked like magic!

+ 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. Looping code to create charts
    By shumba in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-30-2010, 11:48 PM
  2. Looping through a workbook with sheets and charts
    By Masact in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2009, 05:59 PM
  3. Creating simple charts from multiple pivot table charts
    By hovaucf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2008, 04:13 PM
  4. creating charts from multiple sheets for powerpoint
    By dbrine in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 05-18-2008, 11:58 AM
  5. [SOLVED] Looping Through Charts / ChartObjects
    By William Benson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-28-2005, 09:05 PM

Tags for this Thread

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