+ Reply to Thread
Results 1 to 10 of 10

change matched cells background color

  1. #1
    Registered User
    Join Date
    02-11-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    71

    Unhappy change matched cells background color

    Hi Guys,

    Macro is not working

    So the macro I am using is supposed to look back at all the months tab, match the Name from previous tabs and if they match change background color of the active sheet's cell to red.

    Right now the macro is only able to lookup the name in the previous tab (i.e. For December it will only lookup November tab and not October-January).

    e.g. (Candidate name is Jack King and he is in (october’s tab, Column A Cell 2 )
    I want this candidate name to turn red once I type his name in November/December tab.

    I have pasted the code I am using below

    Any help would be appreciated.


    Please Login or Register  to view this content.
    Last edited by nawGo; 03-13-2014 at 04:08 PM.

  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,623

    Re: Macro not working

    You activate one sheet, the next one (previous is deactivated) and do on so finally only
    Please Login or Register  to view this content.
    is effective. Thus only November
    and here
    Please Login or Register  to view this content.
    you (it condition is met) colour rcell (one of cells in ws12)
    if you want to colour found cell change it into
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  3. #3
    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,623

    Re: Macro not working

    so let's try to get closer to final version:
    Please Login or Register  to view this content.
    Add other months and check if it is working. If not - try to debug - may be there are some spell problems - no attachment to test code

  4. #4
    Registered User
    Join Date
    02-11-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: Macro not working

    Hi Kaper, Thank you for replying!

    I tried your macro and it's partially working, it is making all the cells red.
    I tried it in the December tab, Cells A3 and A14 shouldn't be red as those are't repeated elsewhere. I am attaching the excel workbook for your reference!
    Last edited by nawGo; 03-13-2014 at 03:32 PM.

  5. #5
    Registered User
    Join Date
    02-11-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: Macro not working

    Hi Just bringing this up again, any input would be appreciated! Thanks!

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Macro not working

    Hi, nawGo,

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  7. #7
    Registered User
    Join Date
    02-11-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: Macro not working

    Hi Holger, I have changed the title.

  8. #8
    Registered User
    Join Date
    02-11-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: Macro not working

    Hi Holger, I have changed the title.

  9. #9
    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,623

    Re: change matched cells background color

    This shall work with previous months:
    Please Login or Register  to view this content.
    if you want to deal with all months call the above one in a loop like this:

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    02-11-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    71

    Re: change matched cells background color

    Hi Kaper, thanks for all your input

    My above requirement had a major flaw which was that the name would highlight once this meant that I wouldn't be able know the number of times the name has appeared in the workbook. Hence my previously proposed macro was flawed.

    What I ended up doing was that I created a new column and used countif function that counted the number of times the name appeared in the previous tabs.
    If the name matched it would return the number of times it matched. If it didn't match it returned 0. Also, it changed the background color to blue if the number was >0

    I used the following code for december's sheet:

    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)

Similar Threads

  1. Macro not working while running multiple others macro..
    By calvinle in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-07-2014, 11:27 AM
  2. [SOLVED] Macro to merge duplicate rows unique values - current macro not working
    By aimeecrystalaid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-06-2013, 03:42 PM
  3. Macro not working in Excel 2010 but working in Excel 2003
    By mvel_sky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2013, 04:18 PM
  4. Converting workbook with Macro to a template causes the Macro to stop working
    By Skeeta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2012, 02:00 PM
  5. Macro Stopped Working and Macro Not Listed
    By XLevel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2011, 04:43 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