+ Reply to Thread
Results 1 to 5 of 5

Macro has a bug when producing a graph

  1. #1
    Registered User
    Join Date
    04-14-2010
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    21

    Macro has a bug when producing a graph

    Hello, I have got well under way with help from many of you in producing my macro to do some processing on data files. I got the code sorted to select data and produce a graph. I copied and modified this code to then select different data and produce another graph......that worked ok. I then copied and modified to produce a third graph and a bug cropped up when running the macro. It looks like the graph was created as I wanted by I got error message "The index into the specified collection is out of bounds"

    At the moment after running the macro the three graphs are on top of each other, you can drag to separate which I will try and do further in the macro. The graphs don't look too meaningful but that's only because I have deleted many rows of data to keep under the maximum filesize for upload here.

    Once someone kindly replies to a post I am aware that the post needs marking as resolved. I have also been giving positive feedback to the person who has helped too. Is it etiquette to also reply to the thread to say " thanks that works great" or similar?

    Please find the code and excel file attached, thanks.



    Please Login or Register  to view this content.
    Attached Files Attached Files

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

    Re: Macro has a bug when producing a graph

    the error is related to the text formatting of a number of characters that is greater than the text length
    you had 8 character length when the text is only 5 long

    Please Login or Register  to view this content.
    you can add code to position chart objects to avoid the overlay problem.

    It's always good to have the OP acknowledge the reply has worked either by seeing the SOLVED status or a last post comment
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    04-14-2010
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    21

    Re: Macro has a bug when producing a graph

    Worked a treat thanks Andy, what can I check for to look what character length something is ready for when I do the next graph, Im not sure what the 1,8 or 1,5 relates to in my data? Cheers Dominic

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

    Re: Macro has a bug when producing a graph

    if you want it to apply to all the characters in the text then you don't need a start and length value

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-14-2010
    Location
    England
    MS-Off Ver
    Office 365
    Posts
    21

    Re: Macro has a bug when producing a graph

    Perfect, covers all bases now, thanks very much :-)

+ 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. My Macro is not producing the correct output. Help please!
    By ioecho in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-03-2015, 12:54 PM
  2. Problems Producing a Stack Graph
    By masond3 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-04-2013, 07:34 AM
  3. Macro no longer producing desired data
    By xforum142riidax in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2011, 03:25 PM
  4. Macro no longer producing desired data
    By xforum142riidax in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2011, 01:19 PM
  5. recorded macro for pagesetup producing error
    By suprme32excel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-27-2009, 05:51 PM

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