+ Reply to Thread
Results 1 to 9 of 9

VBA Code to paint the cell, when the result from if function is "yes".

  1. #1
    Registered User
    Join Date
    03-21-2022
    Location
    Yerevan, Armenia
    MS-Off Ver
    MS Office 2019
    Posts
    12

    VBA Code to paint the cell, when the result from if function is "yes".

    Hi everyone,

    Hope you had a great weekend!!

    I need a VBA code to paint the cells, where the result from if function is "yes".

    Thanks in advance
    Last edited by grubenyan; 03-21-2022 at 01:23 PM.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: VBA Code to paint the cell, when the result from if function is "yes".

    It would be easier to help and test possible solutions if you could attach a copy of your file. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary). See the yellow banner at the top of this page for instructions to attach a file.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    03-21-2022
    Location
    Yerevan, Armenia
    MS-Off Ver
    MS Office 2019
    Posts
    12

    Re: VBA Code to paint the cell, when the result from if function is "yes".

    I need to paint the row, when the "J1" is 1. When the "J1" is 0, there is nothing to do about!
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-21-2022
    Location
    Yerevan, Armenia
    MS-Off Ver
    MS Office 2019
    Posts
    12

    Re: VBA Code to paint the cell, when the result from if function is "yes".

    Please see this attachment!!
    Attached Files Attached Files

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: VBA Code to paint the cell, when the result from if function is "yes".

    Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Enter a 1 in column J and press the RETURN key.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    03-21-2022
    Location
    Yerevan, Armenia
    MS-Off Ver
    MS Office 2019
    Posts
    12

    Re: VBA Code to paint the cell, when the result from if function is "yes".

    It worked but not fully. When I put the "if" code and copy that till the end it does not work, it only works for 1 row not more

  7. #7
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: VBA Code to paint the cell, when the result from if function is "yes".

    Try:
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-21-2022
    Location
    Yerevan, Armenia
    MS-Off Ver
    MS Office 2019
    Posts
    12

    Re: VBA Code to paint the cell, when the result from if function is "yes".

    You're awesome!!! Thank you

  9. #9
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: VBA Code to paint the cell, when the result from if function is "yes".

    You are very welcome.

+ 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: 10
    Last Post: 03-19-2022, 09:40 AM
  2. [SOLVED] Add extra "InStr" function within a "Split" code solution
    By therealdees in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-18-2021, 08:20 AM
  3. [SOLVED] Nested HLOOKUP returns "FALSE" in cell where result should be "0.00"
    By gammccubbin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-09-2016, 09:49 AM
  4. Replies: 9
    Last Post: 09-05-2012, 10:23 AM
  5. Replies: 5
    Last Post: 10-12-2010, 06:46 AM
  6. display of "result" cell after using 'vlookup' function
    By telugupriyuralu in forum Excel General
    Replies: 6
    Last Post: 01-10-2009, 01:50 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