+ Reply to Thread
Results 1 to 13 of 13

Apply macro to unique seqence of cells colored cells

  1. #1
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Apply macro to unique seqence of cells colored cells

    My data looks like this
    Capture1.PNG

    I need for each unique color sequence to get the unique string from the cells of column E which is made up of the unique segments separated by the pipe "|"

    Please Login or Register  to view this content.
    The unique string from the cells of column E for HH is
    Please Login or Register  to view this content.

    I need the data it to look like this
    Capture2.PNG

    I can get the Unique string from the code below but I can not get how to apply it per uniquely colored sequence

    I have uploaded a workbook

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,517

    Re: Apply macro to unique seqence of cells colored cells

    Try
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-08-2016
    Location
    Cagayan De Oro City, Philippines
    MS-Off Ver
    2013
    Posts
    152

    Re: Apply macro to unique seqence of cells colored cells

    looking at the layout, it seems that each color sequence has a specific label (All HH are blue, All AA are red etc) if this is the case then once you have got the strings in the dictionary just loop through the range again and find the first item of that specific label, and place the new string in the column, then continue looping finding all the other labels with the same label and delete them all.this would leave you with a single item of label "AA" for example with the new string...... you may also want to find the phone number too and store that so you can add this with the new string.

  4. #4
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: Apply macro to unique seqence of cells colored cells

    jindon your code worked beautifully

    In my effort to solve my problem I whittled down the data set as a place to start when I posted my question I forgot I was still using this shortened data set

    My apologies for this over site

    I have two other columns F and G both of which need the same process run on them as column E the "real data" looks like this
    Capture4.PNG

    I tried tweaking your code but can not get it
    I uploaded a new work book

    Thanks

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,517

    Re: Apply macro to unique seqence of cells colored cells

    Not sure about how you want it in col.G though.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: Apply macro to unique seqence of cells colored cells

    jindon thanks again, I have uploaded a new workbook with what I am looking for (should have done this last time)
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,517

    Re: Apply macro to unique seqence of cells colored cells

    Still not sure.
    Highlite the difference, iuf this is not how you want it,
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: Apply macro to unique seqence of cells colored cells

    jindon almost there,
    the segments that make up the strings for column F & G like the in column "E" need to be unique no segment repeated just the largest string of unique segments, the correct data is there it is just not unique

    You have the process perfect for column E
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,517

    Re: Apply macro to unique seqence of cells colored cells

    I'll have a look at the file tomorrow, it is late here.

  10. #10
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: Apply macro to unique seqence of cells colored cells

    Thanks

    The data in the columns F & G is correct the segments just need to be made unique

  11. #11
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,517

    Re: Apply macro to unique seqence of cells colored cells

    Try change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    07-11-2010
    Location
    Minneapolis, USA
    MS-Off Ver
    Excel 2016
    Posts
    308

    Re: Apply macro to unique seqence of cells colored cells

    jindon, thank you your code executes beautifully it will save me many hours of tedious labor over the months to come

  13. #13
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,517

    Re: Apply macro to unique seqence of cells colored cells

    No problem.

+ 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: 4
    Last Post: 01-19-2016, 10:24 PM
  2. Can I apply a macro that sorts within individual cells to a selection of cells at once?
    By Colleen1213 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2015, 02:41 PM
  3. Macro which sums up equally colored cells
    By Marina86 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-01-2013, 08:40 PM
  4. Replies: 1
    Last Post: 11-09-2013, 02:43 AM
  5. Get Count of Colored Cells with Macro
    By Cansa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-03-2013, 11:58 AM
  6. Modify macro to count colored cells
    By headbanger51 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-15-2008, 05:51 PM
  7. Have blocks of blue colored cells ... want them surrounded by lavender-colored cells
    By rocket1406 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-01-2007, 03:59 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