+ Reply to Thread
Results 1 to 6 of 6

Color a cell depending on the result of another cell

  1. #1
    Registered User
    Join Date
    11-03-2022
    Location
    Germany
    MS-Off Ver
    Office 10
    Posts
    2

    Color a cell depending on the result of another cell

    Hi everyone,

    I would like to color a cell in a sheet based on a result of another cell in onother sheet.
    Here is source dataSheet1 excel draft.jpg
    iI would like to color the ref from Sheet 1 in the column A if the ref in sheet 2 are the same ref and the value in the colum B is greater than 0
    Could you please correct my code here below?
    Please Login or Register  to view this content.
    Thanks for your help
    Attached Images Attached Images
    Last edited by BastiDE; 11-03-2022 at 05:49 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: Color a cell depending on the result of another cell

    Try this:

    Please Login or Register  to view this content.
    Barriers are there for those who don't want to dream

  3. #3
    Registered User
    Join Date
    11-03-2022
    Location
    Germany
    MS-Off Ver
    Office 10
    Posts
    2

    Re: Color a cell depending on the result of another cell

    Hi
    I have got this error
    Subscript out of range (Error 9)
    Any help?
    Thanks

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question Re: Color a cell depending on the result of another cell


    Hi,

    any information rather than a guessing challenge ?
    Any attachment ?

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: Color a cell depending on the result of another cell


    According to the initial post it can be directly achieved with an Excel conditional formatting rather than with any VBA procedure …

  6. #6
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: Color a cell depending on the result of another cell

    Sorry for answering so late.

    Where in the code do you find the error?
    Did you check if the columns for Ref and Stock are correct?

    I tested and did run OK for me

+ 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. Replies: 1
    Last Post: 09-18-2018, 04:57 PM
  2. [SOLVED] Changing an empty cell's background color depending on a different cell value.
    By Excell4Dummies in forum Excel General
    Replies: 6
    Last Post: 08-07-2014, 04:10 PM
  3. [SOLVED] Change cell color depending on cell color, error in code
    By mushedpotatos in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-25-2014, 04:20 AM
  4. Color a specific cell depending on a color of a cell in another workbook
    By Pilot604 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-22-2014, 05:43 PM
  5. Macro that is column specific & changes cell color depending on cell contents
    By zurispowell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-25-2012, 05:03 PM
  6. Replies: 3
    Last Post: 07-08-2010, 06:48 PM
  7. Replies: 5
    Last Post: 11-02-2005, 06:20 PM

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