Poll: Color change of shapes in Excel vba

Be advised that this is a public poll: other users can see the choice(s) you selected.

+ Reply to Thread
Results 1 to 6 of 6

Query change the Shapes color by entering value in cell

  1. #1
    Registered User
    Join Date
    12-05-2014
    Location
    New Delhi
    MS-Off Ver
    2013
    Posts
    2

    Query change the Shapes color by entering value in cell

    Dear All,

    I have a query regarding change the Shape color by changing the cell value .

    I have four pillar and each pillar has contain 4 Shapes , Each shape assign with different cells, I enter "1" in cell , shape color changed in yellow if cell value is 0 then shape color remain white.



    Please find the attachment for your reference.
    Attached Files Attached Files

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Query change the Shapes color by entering value in cell

    Hello,

    if you want to do this with shapes you will need code. There is a way to do this without code if you use cells and conditional formatting. You may need to re-arrange your data entry cells.

    See attached file.
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Query change the Shapes color by entering value in cell

    Shape_ColoringTest.xlsm

    Exaclty - Much simpler with CF in cells -

    Code (I am new to VBA) but I would if tasked with this...do it like this.

    On the worksheet that this lives so Sheet 2 for you, the following would be entered

    Probably a more efficient way to do this - but basically I am checking to see if there was a change to any of your cells
    Please Login or Register  to view this content.
    Next in a Module we need to add an Update sub -

    Again, probably a clean loop method that could be applied, I am not there yet... but it checks if the related cell is a 1 if so make the corresponding (Now named) Shape Yellow, otherwise make sure it is white. Runs through all of the cells and updates the colors. It will always jump to A11 after updating a cell as this is the last range I select just to deselect the shapes in the process -
    Please Login or Register  to view this content.
    So again, probably a more efficient way to code that, but there you go - and as Teylyn pointed out... CF is going to be much simpler in the end -
    -If you think you are done, Start over - ELeGault

  4. #4
    Registered User
    Join Date
    12-05-2014
    Location
    New Delhi
    MS-Off Ver
    2013
    Posts
    2

    Re: Query change the Shapes color by entering value in cell

    Thanks for Reply!

    I have 100 pillar with other shapes , I think provided code will be out of limit a module.

    Is there any way to finish it like loop something.

  5. #5
    Valued Forum Contributor
    Join Date
    11-22-2014
    Location
    Arizona, USA
    MS-Off Ver
    Office 365
    Posts
    973

    Re: Query change the Shapes color by entering value in cell

    I am still new with the VBA - I would end this thread (Mark as solved) then take the above code and ask in the VBA/Programming section for a way to loop that and explain that this is a sample of what you are doing, the amount of shapes is actually much more than that in which you see here. Also give them the name format of the shapes in your book -

    TO mark it as solved go to thread tools near the top of this thread.

    Good luck!

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Query change the Shapes color by entering value in cell

    You can shorten the change event to just:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

+ 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. [SOLVED] Color of shapes from cell content
    By SIMBAtheCAT in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-03-2014, 03:23 PM
  2. Entering text on shapes
    By Russell Dawson in forum Word Formatting & General
    Replies: 4
    Last Post: 12-04-2013, 04:20 AM
  3. Change color of shapes based on cell values.
    By rkostner in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-24-2013, 05:55 PM
  4. [SOLVED] Change color of text for a group of shapes
    By emiliekatherine in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-27-2012, 08:43 AM
  5. Replies: 1
    Last Post: 04-13-2006, 07:30 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