+ Reply to Thread
Results 1 to 21 of 21

Change cell color if sheet name in cell matches exactly

  1. #1
    Registered User
    Join Date
    08-21-2015
    Location
    calgary,canada
    MS-Off Ver
    2010
    Posts
    66

    Change cell color if sheet name in cell matches exactly

    WORKBOOK called master log list

    first sheet called master log
    2nd sheet called 123456
    3rd sheet called 456789
    4th sheet called 789123
    5th sheet called 456123
    etc etc etc

    cell H2 on master log sheet , I would like to turn this cell green and show word complete if cell E2 on same sheet matches any of the subsequent sheet names.


    so basically here's my arguments

    with formula in cell H2 on sheet called MASTER LOG

    change this cell (H2) to green and display the word COMPLETE if cell E2 on this sheet matches exactly the name of any other sheet in this workbook. otherwise leave it blank.



    thanks for any help here.

    mike rand
    Last edited by mike rand; 06-23-2018 at 04:14 PM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Change cell color if sheet name in cell matches exactly

    Right Click on "Master Log" at the bottom of excel and select view code.

    Paste this code in the module that opens and close it

    Select E2, Type 123456 and then Enter.


    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    08-21-2015
    Location
    calgary,canada
    MS-Off Ver
    2010
    Posts
    66

    Re: Change cell color if sheet name in cell matches exactly

    Ive followed your instructions and when i type in 123456 into cell e2 it comes up with a

    compile error
    Next without for


    not sure what that means.

    thanks

    mike rand
    Last edited by mike rand; 06-24-2018 at 03:23 PM.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Change cell color if sheet name in cell matches exactly

    This formula will pulls sheet name for you - you then just need to compare that with whatever you want
    =MID(CELL("Filename",A1),FIND("]",CELL("Filename",A1))+1,255)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    08-21-2015
    Location
    calgary,canada
    MS-Off Ver
    2010
    Posts
    66

    Re: Change cell color if sheet name in cell matches exactly

    not sure how to post an attachment of the workbook so you may be able to see whats wrong with code easier.

    can you help?

    thanks
    mike rand

    ps ive figured it out i need to start a new post to do it i cant add attachment to replys
    Last edited by mike rand; 06-24-2018 at 03:27 PM.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Change cell color if sheet name in cell matches exactly

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Change cell color if sheet name in cell matches exactly

    How about
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-21-2015
    Location
    calgary,canada
    MS-Off Ver
    2010
    Posts
    66

    Re: Change cell color if sheet name in cell matches exactly

    ok perfect done,, ive reposted in the macro vba part of the forum


    thanks for your help so far,

    mike rand

  9. #9
    Registered User
    Join Date
    08-21-2015
    Location
    calgary,canada
    MS-Off Ver
    2010
    Posts
    66

    Re: Change cell color if sheet name in cell matches exactly

    wowsers,


    fluff
    whatever you changed it worked perfectly it now searches and finds the sheet with the same work order and makes h2 green and complete.

    however
    it only works in row 2
    also when i remove the workorder number from e2 it doesnt remove the green and work complete from h2.
    when i put another workorder in e3 it does not search or change to green and show complete.

    it may be that i wasn't clear that i needed it to continue down the whole column. my bad

    thanks for your awesome work and help so far.

    mike rand
    Last edited by mike rand; 06-24-2018 at 03:53 PM.

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Change cell color if sheet name in cell matches exactly

    In that case use
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    08-21-2015
    Location
    calgary,canada
    MS-Off Ver
    2010
    Posts
    66

    Re: Change cell color if sheet name in cell matches exactly

    yes works now

    you the man

    it works all the way down and shows green and complete.


    however
    when i remove the workorder number from column E , column H does not revert back to blank, it stays green and complete.
    and when i do remove the workorder number from column e it comes up run time error 13 everytime i remove a workorder number from the column.
    i would like column h to be able to revert to blank if a work order has been removed from column e.


    thanks a million
    this is awesome

    mike rand

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Change cell color if sheet name in cell matches exactly

    Ok how about
    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    08-21-2015
    Location
    calgary,canada
    MS-Off Ver
    2010
    Posts
    66

    Re: Change cell color if sheet name in cell matches exactly

    PEEEERFECT

    UNBELIEVABLE

    one day i hope to be as good as you with this, learning everyday

    it now clears the green and complete

    butttt

    a small thing

    when it clears the green and complete it also clears the border around the cell is this something i just have to deal with or is it something i can correct .


    thanks a million


    mike rand

  14. #14
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Change cell color if sheet name in cell matches exactly

    How about
    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    08-21-2015
    Location
    calgary,canada
    MS-Off Ver
    2010
    Posts
    66

    Re: Change cell color if sheet name in cell matches exactly

    fluff 13


    i've noticed another small little thing as well,

    when i put a work order into column e then create the material takeoff with the same work order number it doesn't change cell in column h to green for that work order.

    only when the material takeoff is completed first then the work order is inputted into column e does it work.

    i kind of need to be able to list hundreds of workorders in column e then as i create the takeoffs have column h turn to green complete as they are created.

    sorry for this. just trying to figure it out as i go .

    thanks
    mike rand

  16. #16
    Registered User
    Join Date
    08-21-2015
    Location
    calgary,canada
    MS-Off Ver
    2010
    Posts
    66

    Re: Change cell color if sheet name in cell matches exactly

    half way there

    removes the complete but not the green and boarder

    thanks

    mike rand

  17. #17
    Registered User
    Join Date
    08-21-2015
    Location
    calgary,canada
    MS-Off Ver
    2010
    Posts
    66

    Re: Change cell color if sheet name in cell matches exactly

    still only removing the word complete
    leaves the green

    thanks

    mike rand

  18. #18
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Change cell color if sheet name in cell matches exactly

    I missed a bit
    Please Login or Register  to view this content.

  19. #19
    Registered User
    Join Date
    08-21-2015
    Location
    calgary,canada
    MS-Off Ver
    2010
    Posts
    66

    Re: Change cell color if sheet name in cell matches exactly

    perfect

    awesome.

    did you see the post on the last problem i am having about it only working one way.


    your code works perfect now but i noticed that if i put all my workorders in the column e then create the material takeoffs it doesnt look for them and turn them green and complete

    it only works if i create the material takeoff first then put the workorder number into the column e

    is there a way that it will work both ways.

    if not both ways it would better suit the application for me to be able to list all my work orders and as i create the material takeoffs have them change to green complete while still having them go blank as i need to delete them from the list.

    thanks

    mike rand
    Last edited by mike rand; 06-24-2018 at 05:23 PM.

  20. #20
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Change cell color if sheet name in cell matches exactly

    How about
    Please Login or Register  to view this content.

  21. #21
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Change cell color if sheet name in cell matches exactly

    My Apologies

    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. change cell font to strikethrough on another sheet based on cell color
    By mlarson in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-13-2018, 01:47 PM
  2. Using Macro to change cell color based on reference cell value in different sheet
    By Emma Ford in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2015, 03:51 AM
  3. [SOLVED] EXCEL NEWB.....Change cell color based on text in a cell on another sheet
    By anon1988 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-27-2014, 12:16 AM
  4. Replies: 2
    Last Post: 07-01-2013, 05:01 PM
  5. Change cell color when cell value matches a listing of cells
    By dfrazier4604 in forum Excel General
    Replies: 2
    Last Post: 02-06-2013, 07:35 PM
  6. Replies: 3
    Last Post: 12-16-2012, 12:49 PM
  7. Replies: 3
    Last Post: 06-10-2011, 09:41 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