Consulting

Results 1 to 13 of 13

Thread: Multiple chart combined into one

  1. #1
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,060
    Location

    Multiple chart combined into one

    Rather than visually clog up a worksheet with multiple charts, is it possible for one chart to reflect different sets of data depending on the selection made from a Data Validation cell?

    In the attached workbook "Varroa 2.xlsx" Im trying to show the different temperature bands that each of the chemicals may be safely used in, compared to the actual day by day temperatures recorded. In these charts provided (one for Formic Pro, the other ApiGuard), they share the same common Dates and Actual Max & Min temps, but differ with regards to the safe temp bands. Formic Pro uses Columns D:E whilst APiGuard uses F:G.

    In the end there may be 6 or 7 Chemicals with different safe operating bands, so rather than 6 or 7 charts can it be combined into one super chart depending on the selection?
    Attached Files Attached Files
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  2. #2
    VBAX Mentor
    Joined
    Nov 2022
    Location
    The Great Land
    Posts
    337
    Location
    Certainly. And might not even need VBA. Review this tutorial https://www.automateexcel.com/charts...ctive-dynamic/
    How to attach file: Reading and Posting Messages (vbaexpress.com), click Go Advanced below post edit window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,060
    Location
    This is running on a Mac so i'm limited somewhat compared to Microsoft systems. However its very informative the link you provided. I must admit I was starting to think I had the guru's stumped on this one.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  4. #4
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,198
    Location
    Attached is a method using the function CHOOSECOLS

    I have:
    converted your range A:G into a table object
    Put the columns to choose in column J
    Wrote a small formula in cell AD2
    Attached Files Attached Files
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2403, Build 17425.20146

  5. #5
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,060
    Location
    Not quite what I'm chasing Georgiboy. If possible I'd prefer to select the chemical and it adjusts the secondary axes.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  6. #6
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,198
    Location
    I couldn't see your chart on the original attachment as one of the axes returned a #REF error ad the chart was blank.

    On what I offered if you select Formic Pro, the chart shows the data for A:E, if you select ApiGuard then it shows the data for A:C and F:G
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2403, Build 17425.20146

  7. #7
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,060
    Location
    Yes, that was my mistake. Please find attached "Varroa 3". Here's what I'm thinking. There is a data validation cell at "I2", while it currently only exhibits two choices now, later on it may have 6 or more. With each different value the secondary axes data should change. That is, the safe temp range as indicated by the "Apricot" colour should be replaced by the one defined by its values in the relevant columns.
    Attached Files Attached Files
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  8. #8
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,198
    Location
    Here is another way of doing it, a simple method, you would just create a little table that is currently behind the chart/ graph. The title of the chart/ graph will also update.
    Attached Files Attached Files
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2403, Build 17425.20146

  9. #9
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,060
    Location
    Well gosh darn it Gerogiboy.... I don't know what to say. Did I mention that this is meant to run on a Mac?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  10. #10
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,198
    Location
    Does that last attachment not run on MAC?
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2403, Build 17425.20146

  11. #11
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,060
    Location
    Does now.... can't explain it. When I downloaded it the first time it showed functions that dont work on a Mac (scroll bars, drop boxes etc), and the sheet was simply dead in the water. Saved it my desktop and still nothing. This time clicked on the Data validation cell and up pops a Group box which wont go away. Data validation works and single chart changes as it should. Going to close down the system, go to bed and hopefully all is well in the morning.

    Thank you Georgiboy for your assistance.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  12. #12
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,198
    Location
    Here is a file with all of the bits added from the different threads that contain the same spreadsheet:
    Select date ranges (more can be added)
    Multiple chemicals on one chart (More can be added)
    Highlight + or - and editable variance of degrees

    No VBA and no Power Query in the file
    Attached Files Attached Files
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2403, Build 17425.20146

  13. #13
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,060
    Location
    Excellent work Georgiboy. Thank you
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •