+ Reply to Thread
Results 1 to 21 of 21

Percentage number to have a Fill up to its value.

  1. #1
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Percentage number to have a Fill up to its value.

    Hi, just curious, is it possible to have a "Word Art" link to a Cell which contain %. Then this "Word Art" have a Blue Colour Fill. But the Fill's Level depend on the %. For example, the Fill reach only half of the Word Art when its 50%. When the value change to 75%, the Fill Level reach 3/4 of the Word Art.

    I have tried to create chart, link picture etc, but still in vain.... Is it possible??

  2. #2
    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: Percentage number to have a Fill up to its value.

    Have you tried Conditional Formatting for this? Use the 1st rule (format cells based on their value), and play around with the Format Style to see if you get what you need?
    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

  3. #3
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Percentage number to have a Fill up to its value.

    Quote Originally Posted by FDibbins View Post
    Have you tried Conditional Formatting for this? Use the 1st rule (format cells based on their value), and play around with the Format Style to see if you get what you need?
    I have think of that as well. But somehow, i cannot think of a way to set the Fill Level. The one i can think of is Bar Data. But Bar Data is Horizontal. Not vertical. haiz...

  4. #4
    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: Percentage number to have a Fill up to its value.

    Have it with 1 color that you want, and the other color white?

  5. #5
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Percentage number to have a Fill up to its value.

    Quote Originally Posted by FDibbins View Post
    Have it with 1 color that you want, and the other color white?
    Are you able to attach an example?

  6. #6
    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: Percentage number to have a Fill up to its value.

    Upload your sample WB and I will take a look

  7. #7
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Percentage number to have a Fill up to its value.

    Quote Originally Posted by FDibbins View Post
    Upload your sample WB and I will take a look
    Hi, please see attached for Sample.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Percentage number to have a Fill up to its value.

    Quote Originally Posted by jp16 View Post
    Hi, please see attached for Sample.
    Anyway, i got this idea when I am charging my HP. The % is show in this way, i think it will be cool if i am able to put it into Excel when I am doing report. =)

  9. #9
    Registered User
    Join Date
    07-19-2017
    Location
    Austria
    MS-Off Ver
    2016, 2010
    Posts
    5

    Re: Percentage number to have a Fill up to its value.

    Hi Jp,
    I can't think of a way of controlling the fill color of the Wordart without VBA, but a nice effect would be when your number is the same but the bar in the percentage sign is used as an indicator of % completion. Like this:
    percentagechart.png
    This method replaces the / in the % with an in-bar chart (like the battery usage icon) and the camera tool to make it fit well with the wordart...

    Leila

  10. #10
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Percentage number to have a Fill up to its value.

    VBA? How can it be done? If possible, can you attached a Sample?
    Anyway, the filled Bar is done using Paste Link Picture from a bar chart then rotate right?
    Last edited by AliGW; 07-22-2017 at 05:05 AM.

  11. #11
    Registered User
    Join Date
    07-19-2017
    Location
    Austria
    MS-Off Ver
    2016, 2010
    Posts
    5

    Re: Percentage number to have a Fill up to its value.

    I Think it should be possible to control the gradient fill color with some VBA logic but I haven't tried it. When I get a chance, I'll have a god and see what I come up with.
    Yes - that's a picture link and rotated. I used an in-bar so made a thinner bar on secondary axis, and fatter one on the primary - overlapped 100%. The 100% bar has no fill and a border.
    This will make a good YouTube video actually

  12. #12
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Percentage number to have a Fill up to its value.

    Oh ya. Gradient fill. Never thought of that. Now you mention gradient fill, i believe it can be done. But then, there wont be a clear straight line between the two colour right? Maybe there is a way to create a straight line, but just that i duno how to do the setting...

    Hope you can shine some light. Looking forward to your video.
    Last edited by AliGW; 07-22-2017 at 05:05 AM.

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

    Re: Percentage number to have a Fill up to its value.

    You need 4 positions on the gradient fill to get a clean divide.

    Another quirk is the fill does not start and finish at 0 to 100%. The filling of the text is dependent on the font used and is between 25 and 75.

    The attached uses a UDF (user defined function)


    Also a version that uses a xy scatter to fill in the / of the % sign.
    Attached Files Attached Files
    Last edited by Andy Pope; 07-22-2017 at 05:14 AM.
    Cheers
    Andy
    www.andypope.info

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,756

    Re: Percentage number to have a Fill up to its value.

    JP - please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  15. #15
    Registered User
    Join Date
    07-19-2017
    Location
    Austria
    MS-Off Ver
    2016, 2010
    Posts
    5

    Re: Percentage number to have a Fill up to its value.

    Here's my sample VBA code with using gradient fill. I am using two gradient stops. If you want to be able to clearly see the colors horizontally, you need to go to "text effects", "transform" and use "square format" (see image).
    Otherwise you can change the gradient angle in the code to 0 and it will show the correct percentage vertically.

    Here's the setup and the text type you need to use:
    wordart_fill_vba.png

    Please Login or Register  to view this content.

  16. #16
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Percentage number to have a Fill up to its value.

    THANKS!!!! Dont understand how you do it. But it works! Thanks

  17. #17
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Percentage number to have a Fill up to its value.

    Hey, i have tried your method. But somehow the fill onli work when A1 is a Value and not a formula. I tried entering formula to A1. The fill dont update. How?

  18. #18
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Percentage number to have a Fill up to its value.

    What does the 2 % value in your Formula mean?

  19. #19
    Registered User
    Join Date
    07-19-2017
    Location
    Austria
    MS-Off Ver
    2016, 2010
    Posts
    5

    Re: Percentage number to have a Fill up to its value.

    Hi JP - It works for me when I replace cell A1 with a formula - as long as the result is a % i.e. a value between 0 and 1 since that can be used to control the gradient stops. They will not accept values outside this range, so if you have whole numbers, you need to make sure you translate them to decimals. Could you maybe attach your version and I can take a look?
    Leila
    XelPlus.com
    youtube.com/LeilaGharani

  20. #20
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Percentage number to have a Fill up to its value.

    Hi, here it is.Anyway, lets say if i have more than one textbox/wordart showing different % from different cell.
    Do i have to copy n paste the whole code and edit?
    Attached Files Attached Files

  21. #21
    Registered User
    Join Date
    07-19-2017
    Location
    Austria
    MS-Off Ver
    2016, 2010
    Posts
    5

    Re: Percentage number to have a Fill up to its value.

    I see - for this we need the Calculate worksheet event to check if the formula result has changed:
    If you don't have too many, the easiest way to manage is to keep each on it's own, otherwise you could put the main meat in one procedure and call that one from the other ones.

    Please Login or Register  to view this content.

+ 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. Replies: 1
    Last Post: 09-20-2016, 07:33 PM
  2. [SOLVED] Need to fill a grid of cells with data, based on percentage amount specified.
    By Traymond in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-25-2016, 08:07 PM
  3. [SOLVED] Gradient fill according to percentage
    By nooredein in forum Excel General
    Replies: 14
    Last Post: 04-28-2014, 02:14 PM
  4. Replies: 9
    Last Post: 01-14-2014, 11:04 PM
  5. Replies: 10
    Last Post: 10-30-2013, 07:29 PM
  6. [SOLVED] Compare columns, replace matching number with reference number and fill down random amount
    By datadigger in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-04-2012, 10:53 PM
  7. Replies: 2
    Last Post: 01-31-2008, 07:20 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