+ Reply to Thread
Results 1 to 3 of 3

VBA to select similar coloured cells from a range

  1. #1
    Registered User
    Join Date
    01-25-2018
    Location
    london
    MS-Off Ver
    365
    Posts
    43

    VBA to select similar coloured cells from a range

    I've got an image i made into pixel art in excel, but some of the cells are just slightly off the colour i want them to be, so i was wondering if it was possible to select all cells that are within a certain colour range?

    E.g. the range of the pic was already set and I want to be able to use the colour in the active cell to select all the similar coloured cells in the set range. E.g. the colour i want is 6468036 but some of the cells I want to be that colour are 6665928 or 6991299 if that makes sense?

    Can anyone help with that please?
    Last edited by Oriya; 08-07-2020 at 06:55 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: VBA to select similar coloured cells from a range

    Let's assume we define similarity as any of the 3 components (RGB) not being different by more than 10) from original value. (in your examples maximum difference is 8).
    Then one can use a macro as in attached file

    select cell F3 and run macro. note I3 remains unselected

    select H3, run macro, and note all cells are selected after a macro
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    01-25-2018
    Location
    london
    MS-Off Ver
    365
    Posts
    43

    Re: VBA to select similar coloured cells from a range

    Thank you SO much Kaper! I really appreciate it. This is literally amazing. Also thanks for making where the Tollerance is clear so I can change if needed

+ 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] Identify first cell of each range of coloured cells - adapting a calendar to display name
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-23-2019, 03:49 AM
  2. Make 'ActiveSheet.Range("C5:N100").Select' - select a dynamic range of cells
    By white_ross in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-13-2016, 10:00 AM
  3. How can I count coloured cells (coloured using Conditional Formatting)
    By franfry in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-15-2013, 02:40 PM
  4. [SOLVED] Formula help : Sort by number range and then allocate different coloured cells
    By gandk in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-22-2012, 01:38 AM
  5. [SOLVED] Count coloured cells in range
    By Alberto Pinto in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-20-2006, 02:40 PM
  6. [SOLVED] Count coloured cells in a range
    By [email protected] in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-20-2006, 08:55 AM
  7. Replies: 1
    Last Post: 05-16-2006, 05:20 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