Closed Thread
Results 1 to 2 of 2

Subtracting based on shape color

Hybrid View

  1. #1
    Registered User
    Join Date
    05-07-2019
    Location
    USA
    MS-Off Ver
    2016
    Posts
    10

    Subtracting based on shape color

    Hello all,

    Function CountShapes(rngSearch As Range) As Long
    Dim sh As Shape
    
    For Each sh In rngSearch.Parent.Shapes
       If Not Intersect(rngSearch, Range(sh.TopLeftCell, sh.BottomRightCell)) Is Nothing Then
          CountShapes = CountShapes + 1
       End If
    Next sh
    End Function
    Above is the code I have, and it works nicely. I'm trying to figure out though how to make it subtract 1 from the count based on color of the shape.

    Wanted to add that code is in thanks to Fluff13

    Regards
    G

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Subtracting based on shape color

    Administrative Note:

    Welcome to the forum.

    Unfortunately, this is a duplicate thread, and you are allowed only ONE thread per issue here. I am, therefore, closing this thread, but you may continue here in the original thread: link to be added here

    https://www.excelforum.com/excel-pro...ml#post5116461
    HTH
    Regards, Jeff

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Change Shape Color RGB based on Cells Color
    By jocker_boy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-30-2019, 05:31 AM
  2. VBA change shape color based on cell value
    By noelmus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-29-2018, 06:31 PM
  3. Defining Cell Value Based on Shape Color
    By RunRabbit13 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-11-2016, 05:22 PM
  4. Changing Color of Shape based on cell value
    By sully8014 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-23-2015, 08:02 AM
  5. change color of shape based on value in dropdownlist
    By raketman007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2013, 09:39 AM
  6. If function based on color of the shape
    By mjoll in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-22-2013, 05:52 AM
  7. If function based on color of the shape
    By mjoll in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2013, 04:17 PM

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