+ Reply to Thread
Results 1 to 22 of 22

copy cell color to another sheetint cell with same value

  1. #1
    Registered User
    Join Date
    11-11-2020
    Location
    Germany
    MS-Off Ver
    365
    Posts
    34

    copy cell color to another sheetint cell with same value

    Hi,

    i have 2 sheets
    in sheet1 there is a row with numbers in one column
    in sheet2 there are the same numbers, but in random positions across the sheet

    what i want to do: if i change the background color of any number on sheet1 , it should also change the color of the same number in sheet2.

    After trying to find out how this could be made possible, i found out the only way this could be done is by vba.
    But since i have 0 experience in vba, I would appreciate it, if someone could help me out here.

  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: copy cell color to another sheetint cell with same value

    Indeed, VBA would be probably best option.
    Have a look on advice in a yellow box near the top of the page and prepare sample file with both sheets and layout (not necessarily real data) as close as possible to your real file
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    11-11-2020
    Location
    Germany
    MS-Off Ver
    365
    Posts
    34

    Re: copy cell color to another sheetint cell with same value

    I attached an example file of my current file structure
    i hope it helps.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: copy cell color to another sheetint cell with same value

    Here is an option for you

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by maniacb; 11-12-2020 at 05:32 PM. Reason: Add file

  5. #5
    Registered User
    Join Date
    11-11-2020
    Location
    Germany
    MS-Off Ver
    365
    Posts
    34

    Re: copy cell color to another sheetint cell with same value

    thanks maniacb
    sorry for the long wait.
    if i try your solution nothing happens.
    But even if i download your file to test it there it doesnt work.
    Am I missing something?

  6. #6
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: copy cell color to another sheetint cell with same value

    hi, zerberus123 maniacb's code works very well for me but i thing what is your mistake you do not double click inside the cell do it and see the result

  7. #7
    Registered User
    Join Date
    11-11-2020
    Location
    Germany
    MS-Off Ver
    365
    Posts
    34

    Re: copy cell color to another sheetint cell with same value

    ah thx
    works for me as well now.
    is there any way to avoid double clicking the cells?
    the whole point is that i dont change the numbers, only the colors.
    if i change the color of lets say 50 numbers i dont wanna click each of them

  8. #8
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: copy cell color to another sheetint cell with same value

    you right it takes from you more time actually I'm like you I always ask help from experts in this forum i have no experience to write code i suggest waiting for maniacb surly it will be back and amending the code I suggest when you clear the whole color in sheet1 then clear all colored values in sheet 2 to be come the code is complete
    best, regards
    abdelfattah

  9. #9
    Registered User
    Join Date
    11-11-2020
    Location
    Germany
    MS-Off Ver
    365
    Posts
    34

    Re: copy cell color to another sheetint cell with same value

    Sadly if i implement my own File into the test sheet i still doesnt work (even if i double click).
    I attached a more correct sample file so it's clearer how my files look like.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: copy cell color to another sheetint cell with same value

    that's because the column a="" and the code begins from column a and as for to data begins column d so change

    from this
    HTML Code: 
    to this
    HTML Code: 

  11. #11
    Registered User
    Join Date
    11-11-2020
    Location
    Germany
    MS-Off Ver
    365
    Posts
    34

    Re: copy cell color to another sheetint cell with same value

    nice
    now i just need maniacb to help me avoiding to have to click on every one of them.
    if he finds a way to include background color by conditional format as well i got everything i need

  12. #12
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: copy cell color to another sheetint cell with same value

    Give this code a try. After changing the color you have to select a different cell and the colors will update. Thanks @Adelfatta for the assist.

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    11-11-2020
    Location
    Germany
    MS-Off Ver
    365
    Posts
    34

    Re: copy cell color to another sheetint cell with same value

    hmm
    on my end it still triggers only when i double click on the cell

  14. #14
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: copy cell color to another sheetint cell with same value

    it will trigger with a double click, but you only have to do one double click, not one for each color.

  15. #15
    Registered User
    Join Date
    11-11-2020
    Location
    Germany
    MS-Off Ver
    365
    Posts
    34

    Re: copy cell color to another sheetint cell with same value

    thats the thing
    it only triggers for the number i double click on
    applied your code on my old sample
    Attached Files Attached Files

  16. #16
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: copy cell color to another sheetint cell with same value

    You're right. Can your process support using the ENTER button to force the change? In other words, can you place the cursor on A1 and hold down the enter button until all cells are cycled through. Sorry, I have to think on this some more to give you the desired solution. Would a single update button better meet your needs?

  17. #17
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: copy cell color to another sheetint cell with same value

    Here is a triggered solution

    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    11-11-2020
    Location
    Germany
    MS-Off Ver
    365
    Posts
    34

    Re: copy cell color to another sheetint cell with same value

    Hi,
    no cycling through doesn work. I need to double click it ie. i have to edit it for it to change the color on the other sheet.

    what do i have to do with the triggered solution? Right now i got no change with it, even with double click.

    Sure an update button would be fine as well, if it can save you some work

  19. #19
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: copy cell color to another sheetint cell with same value

    For the trigger/Button solution, enter a button and assign the attached code. I did it in the attached file for you to see.
    Attached Files Attached Files

  20. #20
    Registered User
    Join Date
    11-11-2020
    Location
    Germany
    MS-Off Ver
    365
    Posts
    34

    Re: copy cell color to another sheetint cell with same value

    Nice
    i got it working.

    Thank you!!!

    Quick addon:
    if i wanna do the same for text in B:B is there much to change?
    tried to fiddle with it a bit, but it didnt work
    Last edited by Zerberus123; 11-18-2020 at 06:52 AM.

  21. #21
    Registered User
    Join Date
    03-27-2024
    Location
    Indonesia
    MS-Off Ver
    2016
    Posts
    1

    Re: copy cell color to another sheetint cell with same value

    i have same problem right here,
    but in my case,
    i have bunch of number with colorful background cell in sheet "Master"
    from second sheet called "Edit" i have tons a numbers without background
    how should i do if i wanna use that VBA Code?

    P.S : its only one coloumn on each worksheet

  22. #22
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: copy cell color to another sheetint cell with same value

    Welcome to the Forum. Start a new thread and make sure you provide example data as per the instructions in the yellow section above.

+ 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: Excel VBA Copy Paste Color Cell Range to Selected Cell
    By chhiew in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-22-2018, 02:25 AM
  2. User defined function to copy the cell color to another cell (actual painting the color)
    By sumitgangwani in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-15-2017, 04:14 PM
  3. Change cell format (cell color+font color) based on color of another cell
    By Dedaluss in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-30-2017, 03:27 AM
  4. Replies: 2
    Last Post: 01-31-2014, 09:34 AM
  5. [SOLVED] Macro: Use cell fill color to determine if to copy & paste to another cell on the same row
    By tsamuels in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-19-2013, 09:50 AM
  6. Use VBA to copy Data Validation reference cell font color to destination cell?
    By proav in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-07-2012, 08:09 PM
  7. Replies: 2
    Last Post: 11-08-2011, 11:10 AM

Tags for this Thread

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