+ Reply to Thread
Results 1 to 11 of 11

Designate individual bar colour by CF in 3D graph

  1. #1
    Registered User
    Join Date
    05-22-2016
    Location
    Helsinki, Finland
    MS-Off Ver
    2007
    Posts
    5

    Designate individual bar colour by CF in 3D graph

    Hi!
    Having searched many excel forums for ideas of how to, in a 3D graph, designate an individual bar colour to each 'z' value, by Conditional formatting, I feel I must post this question.
    Must I enter a macro code to make this work? (I have come across a few).
    Say I have a table of 10 rows x 16 columns, with values between 0 to 9.
    Each value shall be designated its own colour.

    I wish, with a second table, to toggle the colours.
    This second table is just a row of the values 0 to 9, where, when I change the background colour of a value,
    also the cells in the first table (10x16) with same value will change to selected colour.

    In the end, the bars of same values in the 3D graph will display that specific colour.

    So far, each row in the 3D graph is of the same colour.
    Attached an example to visualize...
    http://www.excelforum.com/attachment...1&d=1463938661
    Thankful for any help!
    All the Best,
    Martin
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: Designate individual bar colour by CF in 3D graph

    Hi,

    Is this what you are looking for?
    I found this macro on:

    http://peltiertech.com/vba-condition...arts-by-value/

    Please Login or Register  to view this content.
    See attached.

    Hope you find this useful.
    Attached Files Attached Files

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Designate individual bar colour by CF in 3D graph

    Hi, welcome to the forum

    Conditional Formatting (as far as I know) is formatting (cosmetics) that is applied to worksheet cells, based on certain criteria, I dont think it can be used in charts
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    05-22-2016
    Location
    Helsinki, Finland
    MS-Off Ver
    2007
    Posts
    5

    Re: Designate individual bar colour by CF in 3D graph

    Southward, thank you, brilliant !
    I came a long way with that code. However, similar to other postings, only the first row of data was affected.
    The remaining (x-axis) data remains unchanged.
    I went ahead and modified the code according to tips on same thread, but I eventually got stuck
    - please see screenshot of code line.

    Been scratching my head for a few hours.
    Attached my file with my advances, and screenshots.

    All the best, and I am thankful for any push forward!
    Martin
    Attached Images Attached Images
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: Designate individual bar colour by CF in 3D graph

    Hi Mr Martin,

    Sorry about that. I neglected to state that the Chart has to be selected before running the macro.
    I also realize my previous example had the button assigned to the wrong version of the macro. My apologies.
    The macro will take a few seconds to run. Length of time will depend upon PC capabilities and file size.

    See attached.

    Cheers
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-22-2016
    Location
    Helsinki, Finland
    MS-Off Ver
    2007
    Posts
    5

    Re: Designate individual bar colour by CF in 3D graph

    Thank you, Southward

    Unfortunately, I did not manage to open / save with a functioning macro.
    Could you copy paste the code herein?
    Appreciate the effort for the button, that is a good feature. I must learn how to add this feature myself.

    Best Regards,
    Martin

  7. #7
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: Designate individual bar colour by CF in 3D graph

    Hi Mr. Martin,

    At a glance the macro that I have is the same as the one you have.

    Please Login or Register  to view this content.
    In order to not receive the error on :
    Please Login or Register  to view this content.
    you need to have the table selected before running the macro.

    Good luck

  8. #8
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Designate individual bar colour by CF in 3D graph

    Please Login or Register  to view this content.
    just add this before the for each line to avoid having to select the table in order to avoid error

    *replace chart 2 with whatever the chart is called of course
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  9. #9
    Registered User
    Join Date
    05-22-2016
    Location
    Helsinki, Finland
    MS-Off Ver
    2007
    Posts
    5

    Re: Designate individual bar colour by CF in 3D graph

    Hello Southward,

    absolutely helpful, thank you.
    Partly, I had added too much 'nice to have' coding, than staying with the basics.

    Working well!

    All the best,
    Martin

  10. #10
    Registered User
    Join Date
    05-22-2016
    Location
    Helsinki, Finland
    MS-Off Ver
    2007
    Posts
    5

    Re: Designate individual bar colour by CF in 3D graph

    Thank you Humdingaling,

    I may very well need this in the future.

    BRgds,
    Martin

  11. #11
    Valued Forum Contributor
    Join Date
    05-08-2015
    Location
    Uvalde, TX
    MS-Off Ver
    2010
    Posts
    720

    Re: Designate individual bar colour by CF in 3D graph

    Glad I could be of some assistance

+ 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. Colour of Individual alphabets inside a cell by conditional
    By thilag in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-31-2015, 08:24 AM
  2. [SOLVED] Making a single graph with two data sets that have individual dates.
    By damp in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 04-05-2014, 09:49 AM
  3. [SOLVED] How to create Individual Horizontal Line in a Graph
    By dluhut in forum Excel Charting & Pivots
    Replies: 15
    Last Post: 06-07-2012, 03:04 PM
  4. Replies: 1
    Last Post: 07-04-2011, 05:23 PM
  5. Individual Error bars in bar graph
    By Naz_1 in forum Excel General
    Replies: 0
    Last Post: 03-10-2008, 02:46 PM
  6. Labelling individual points on a scatter graph
    By Amethyst in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 11-02-2007, 02:57 AM
  7. [SOLVED] how do i change the colour of individual axis on the graph
    By hhhggghhh in forum Excel General
    Replies: 2
    Last Post: 07-18-2005, 08:05 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