Closed Thread
Results 1 to 10 of 10

Chart on a Userform

  1. #1
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Chart on a Userform

    Hi All

    I want to add a chart to a userform, and i have found a few codes and sites that offer help, but..... im having issues i just cant get it to work, currently i have this

    Please Login or Register  to view this content.
    Which wont work, then i have looked at this site.... http://www.j-walk.com/ss/excel/tips/tip66.htm

    And cant get that to work either, could somone please explain where i should be putting these codes? in a module, or directly into the userform code

    Thanks

    Dan

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

    Re: Chart on a Userform

    The code should be in the userform module.

    The code posted, and for certain John's example, should work. Do you get errors, if so we need details.
    I assume you have a sheet called Charts with charts on it.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Re: Chart on a Userform

    Yes i have the tab called "Charts" where the chart is located, and the image control in the userform is Image1, my current code for the whole userform is very simple

    Please Login or Register  to view this content.
    Its literally a summary box, but i want to extend this now to include graphs, when i put the previously posted code into the module i get this error....

    1. when all the code is in the module = variable not defined on Image2
    2. when i remove the userform_initialize sequence and put it in with my current code = Sub or function not defined, (which i then add "Run" infront of updatechart) and then it works, but doesnt show the graph nor does it save the GIF in the file location

  4. #4
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Re: Chart on a Userform

    When i change it to this....

    Please Login or Register  to view this content.
    And keep the updatechart code in the module, there are no errors, but it still doesnt give me the chart in the userform, or save the GIF

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

    Re: Chart on a Userform

    can you post example file.

  6. #6
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Re: Chart on a Userform

    Hi Andy

    Sorry i had to remove alot of sensitive data, and then overwrite the formulas to give some form of example of what i am after, here is the example

    Thank you, hopefully you may be able to help me, yet again
    Attached Files Attached Files

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

    Re: Chart on a Userform

    I just incorporated the UpdateChart routine into your userform.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Crayford, kent
    MS-Off Ver
    Excel 2013
    Posts
    394

    Re: Chart on a Userform

    Brilliant thanks Andy Pope, i can only assume that i had another sheet open with userform1 in, as when i opened your returned sheet it wouldnt let me open the userform, when i closed all other sheets, it worked exactly how i wanted it too

    Thanks again

  9. #9
    Registered User
    Join Date
    11-27-2023
    Location
    Vienna
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Chart on a Userform

    Quote Originally Posted by Andy Pope View Post
    I just incorporated the UpdateChart routine into your userform.
    Hi Andy,
    I know, it's a quite an old topic, I just found it. I tried to copy your code to mine, but I got runtime error.
    Could you maybe check what the problem could be?

    Tks

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Chart on a Userform

    Administrative Note:

    We are happy to help, however whilst you feel your request is similar or even the same as this thread, we have a rule that you open your own thread on the issue and do not piggy back another member's thread.

    Please see Forum Rule #1 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread. You can link back to this thread if you wish.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. combining chart userform and data transfer userform into 1 userform
    By H_Kennedy in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-04-2014, 07:11 AM
  2. combining chart userform and data transfer userform into 1 userform
    By H_Kennedy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-03-2014, 12:28 PM
  3. Chart in Userform
    By BrianAll in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-22-2013, 01:36 PM
  4. Chart on a Userform
    By Rocky McKinley in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-12-2005, 11:05 AM
  5. how to insert a chart in a userform?
    By Christoph Strobelt [Bt] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-06-2005, 09:05 AM

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