Results 1 to 8 of 8

Highlight the entire row for the specific criteria given in the columns

Threaded View

  1. #1
    Registered User
    Join Date
    09-14-2014
    Location
    Delhi, India
    MS-Off Ver
    Ms Office 2010
    Posts
    19

    Highlight the entire row for the specific criteria given in the columns

    Hi All,

    I am working on one macro. And I am stucked in between, I need to highlight entire row for the values "Yes" in column R and Column S till the end of the columns.

    I am using below code to do the same but somehow only one row gets highlighted and all others row don't highlight. Also It doesn't highlight any row for Column S

    Could anyone please help me to correct this code.

    I have also attached the file to check the macro.

    Sub highlightfinal()
    
       Dim cell As Range
    
       Range(Range("R1"), Range("R1").End(xlDown)).Select
       For Each cell In Selection
          If cell = "Yes" Then cell.EntireRow.Interior.ColorIndex = 4
       Next cell
    
       Range(Range("S1"), Range("S1").End(xlDown)).Select
       For Each cell In Selection
          If cell = "Yes" Then cell.EntireRow.Interior.ColorIndex = 3
       Next cell
       
    
    End Sub
    Thank you in advance
    Attached Files Attached Files
    Last edited by aman2059; 01-17-2016 at 01:51 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Highlight Entire Row if Any Cell is Blank in One or More Specific Columns
    By ptjameso in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-09-2015, 01:17 PM
  2. Highlight Entire Row If Values are in 2 Columns
    By lmarkie74 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-03-2014, 07:32 PM
  3. [SOLVED] highlight entire row in enter specific number
    By edwinculanding in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-09-2014, 05:29 AM
  4. [SOLVED] Macro to group columns based on specific criteria in entire workbook
    By kbkumar in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-09-2012, 04:47 AM
  5. Replies: 3
    Last Post: 09-28-2012, 02:13 AM
  6. [SOLVED] copy select columns instead of entire row if it meets specific criteria
    By liz80 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-18-2012, 04:26 PM
  7. How to highlight the ENTIRE row subject to a specific cell?
    By sami770 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-06-2012, 03:37 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