+ Reply to Thread
Results 1 to 6 of 6

recognizing colored cells in a list and copying to the side

  1. #1
    Registered User
    Join Date
    06-20-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Question recognizing colored cells in a list and copying to the side

    I'm trying to solve this Excel puzzle. What I'm looking to do is recognize project names in a list, and assign them to the roles also in the list. There are a few elements to this puzzle:

    1) Recognizing the project names as such. They are colored differently but that is the only difference. They don't change too often so it would be possible to refer to a static list of them, but I'd have to update that list. I'm told that it takes VBA to recognize cell colors.

    2) Moving the project names to the relevant spots in another column.

    I get the output from some software in the format of the first tab in the attached file. I'd like to make it look like the second tab so that I can make the pivot table shown on the third tab.

    As for my Excel experience, I'm pretty good with Excel but new to macros/VBA. Thanks for any advice you can give!

    Sample File.xlsx

  2. #2
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    154

    Re: recognizing colored cells in a list and copying to the side

    Put the following code in a new module. This will take your first tab and format it like the second, except the Hours column will be 2nd, not 3rd. Just paste this in and run it and you will see.

    Please Login or Register  to view this content.
    pls click the star if you liked my answer!

  3. #3
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    154

    Re: recognizing colored cells in a list and copying to the side

    i noticed that you said the project name does not include the word project. You can change the if line to check for interior color.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-20-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: recognizing colored cells in a list and copying to the side

    Thanks, jkj115! This works great. Now just let me see if I can use my macro knowledge to apply it to my real document, which is a little more complicated. I may have some follow-up questions

  5. #5
    Registered User
    Join Date
    06-20-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: recognizing colored cells in a list and copying to the side

    What do I need to do to make the macro stop if it reaches a cell of ColorIndex=48?

  6. #6
    Registered User
    Join Date
    06-20-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: recognizing colored cells in a list and copying to the side

    Aha! I got it. To make the macro stop I added

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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