+ Reply to Thread
Results 1 to 7 of 7

Copying cell highlighting from one cell in a sheet to another cell on a different sheet

  1. #1
    Registered User
    Join Date
    04-30-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    6

    Post Copying cell highlighting from one cell in a sheet to another cell on a different sheet

    The problem is :

    On Sheet2 in Cells C2 to C5 the values obtained by a formula are 1, 2, 3 and 4.

    I did a conditional formatting to highlight these cells with different colors based on the cell values as Red for Cell Value 1, Yellow for Cell Value 2, Green for Cell value 3 and Blue for Cell value 4.

    So whenever the cell values changes from 1 to 4, the background color in these cells will also changes as assigned.

    Now, on Sheet1 I have an equal number of cells; but distributed as B3, D5, A2 and H7. The values in these cells are A/231, B/276, C/32 and D/654.

    So, how can I dynamically assign colours to these cells by a formula so that B3 will be highlighted with the same colour as C2, D5 will be highlighted with the same colour as C3, A2 will be highlighted with the same colour as C4 and H7 will be highlighted with the same colour as C5, so that whenever the colours in C2, C3, C4 and C5 changes the colours in B3, D5, A2 and H7 changes on to one.

    Please suggest a solution for the above problem, with or without macros.

    Thanks in anticipation

    Rajesh
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Copying cell highlighting from one cell in a sheet to another cell on a different shee

    Have a look at this thread, which uses a macro to copy the cell colours of cells to other cells, and see if it might help: http://www.excelforum.com/excel-form...lls-value.html
    If you can't get it to work for your file, let me know and I'll try amending it for you.
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  3. #3
    Registered User
    Join Date
    04-30-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Copying cell highlighting from one cell in a sheet to another cell on a different shee

    Thanks Aardigspook,

    Thanks for the reply.

    I tried the macro on my workbook. It is working, but not as desired. Like, the linking between cells in Sheet1 and Sheet2 are not dynamic. The changes in background colour that comes in cells on Sheet1 will be reflected on the assigned cells in Sheet2 only after we run the macro is run from the menu.

    What could be the reason. I am attaching the modified file.

    Thanks
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Copying cell highlighting from one cell in a sheet to another cell on a different shee

    I've amended the macro to run on your original example file - here's the amended version: Copy cell colours sheet2 to sheet1 _ for rvgmec.xlsm
    Click Alt-F11 to open the VBA editor, then right-click on 'Sheet2 (Sheet2)' and select 'View Code' - you'll then see this code:

    Please Login or Register  to view this content.
    Any time a change is made to C2,C3,C4 or C5 on Sheet2, this code will run, copying the colours as follows:
    C2 → Sheet1 B3
    C3 → Sheet1 D5
    C4 → Sheet1 A2
    C5 → Sheet1 H7
    If you make a change to any other cell, the code won't run (because there's no reason for it to).

    Does that work for you?

  5. #5
    Registered User
    Join Date
    04-30-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Copying cell highlighting from one cell in a sheet to another cell on a different shee

    Dear Aardigspook,

    The macro is doing its job as intended. Thanks Aardigspook for the help.

    rvgmec

  6. #6
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Copying cell highlighting from one cell in a sheet to another cell on a different shee

    You're welcome, glad to be of help.

    If that solves your problem, please mark the thread as 'Solved' using the 'Thread Tools' above your first post - this keeps the moderators happy and means other members don't waste time reading problems which are already fixed. Thank you.

  7. #7
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Copying cell highlighting from one cell in a sheet to another cell on a different shee

    I got your PM saying that this isn't working in 2007, but working in 2010. I'll reply here so that others can see the problem and possible solutions.

    I don't have 2007, so can't test it there, but a quick search suggests two possibilities:
    1.
    Are macros enabled? In Excel 2007 they won't be if the workbook has a File Open password or if it has Workbook protection.
    2.
    Worksheet Events may have been turned off somehow. Press Alt-F11 to open the VBE, then press Ctrl-G to open the 'Immediate' window (it will open at the bottom right). Type ?Application.EnableEvents then press Enter. If the word 'False' appears, then events have been disabled. Type Application.EnableEvents = True to re-enable them.

+ 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. Highlighting cell updates and logging them to a new sheet
    By JustTrying9 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-15-2015, 12:44 PM
  2. Replies: 1
    Last Post: 04-21-2015, 04:45 PM
  3. Highlighting a row of cells in a cell on a different sheet
    By dpasquerello in forum Excel General
    Replies: 10
    Last Post: 12-05-2014, 07:52 PM
  4. [SOLVED] Macro is copying and pasting into cell A2 on new sheet instead of cell A1 Please Help!
    By AMFISH in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-20-2014, 03:54 PM
  5. copying cell contents to new cell in new work sheet
    By Stujaxon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-22-2012, 06:55 PM
  6. Replies: 3
    Last Post: 04-26-2012, 05:15 PM
  7. Update a cell value from a previous sheet after copying the sheet and renaming it
    By Mistweaver in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-21-2009, 09: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