+ Reply to Thread
Results 1 to 2 of 2

VBA to color All Shapes in a Range

  1. #1
    Registered User
    Join Date
    09-04-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    75

    VBA to color All Shapes in a Range

    Hi All,

    I am looking to change the color of all shapes with a range when another shape is clicked.

    For example i have a shape that is in D9 and when i click it, it changes color but I also have shapes in I9 and J9 that i also need to change color.
    I only want to change the color of the 2 shapes in the same row but not any further than +6 columns.

    I determine the row and column of the original shape based on:
    Please Login or Register  to view this content.
    Thank you very much for your help.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: VBA to color All Shapes in a Range

    Hi jhall488,

    See the attached sample file containing the following code. This should get you pretty close to your requirements. If you need additional help, please upload a sample file.


    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

    Please Login or Register  to view this content.
    It is a best practice to declare all variables. If you misspell a variable in your code, VBA will silently assume it is a Variant variable and go on executing with no clue to you that you have a bug. Go to the VBA development window, click Tools, Options, and check "Require Variable Declaration." This will insert the following line at the top of all new modules:
    Please Login or Register  to view this content.
    This option requires all variables to be declared and will give a compiler error for undeclared variables.

    Lewis
    Last edited by LJMetzger; 08-26-2017 at 01:54 PM. Reason: Added attachment.

+ 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: 5
    Last Post: 08-11-2017, 03:05 PM
  2. [SOLVED] Adding color changing shapes
    By frdranger25401 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-22-2017, 08:17 PM
  3. Fill Color for a Group of Shapes
    By RunRabbit13 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-26-2016, 11:14 PM
  4. [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
  5. color coding shapes
    By deanusa in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-04-2014, 04:01 PM
  6. Help with loop to fill color of shapes (US map)
    By harleyberger in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2012, 01:50 PM
  7. Changing Shapes line color using VBA
    By ABabeNChrist in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-23-2010, 10:58 AM

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