+ Reply to Thread
Results 1 to 3 of 3

How to high entired row based on data in a cell

Hybrid View

  1. #1
    Registered User
    Join Date
    06-30-2010
    Location
    Newport New VA
    MS-Off Ver
    Excel 2003
    Posts
    97

    How to high entired row based on data in a cell

    This one should be easy for you gurus. Basically I want to have an entire row highlight in a redish color if a cell in column K has a 1. But I would like to make this a button function. So that when a person clicks the button called find, it would highlight all rows where the cell in column k has a 1. and then I would like to have a button that when clicked would clear the highlight. Note column K would be a hidden column. It has a formula in it.

    the highlight would be from column A to column G

    I am attaching the file for you to see.

    I highlighted one of the columns in the color I want so you would know when you write the code.

    Thanks everyone...
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: How to high entired row based on data in a cell

    Sub Highlight_Row()
    Dim ws As Worksheet:    Set ws = Sheets("Overdue Traing Compliance") 'check your spelling
    
    Application.ScreenUpdating = False
    
    With ws
        .AutoFilterMode = False
        .Range("K2:K" & .Range("K" & Rows.Count).End(xlUp).Row).AutoFilter 1, 1
        .Range("A3:G" & .Range("K" & Rows.Count).End(xlUp).Row).SpecialCells(xlCellTypeVisible).Interior.ColorIndex = 3
        .AutoFilterMode = False
    End With
    
    Application.ScreenUpdating = True
    
    End Sub
    
    Sub Unhighlight_Row()
    Dim ws As Worksheet:    Set ws = Sheets("Overdue Traing Compliance") 'check your spelling
    
    ws.Range("A3:G" & ws.Range("K" & Rows.Count).End(xlUp).Row).Interior.ColorIndex = 15
    
    End Sub

  3. #3
    Registered User
    Join Date
    06-30-2010
    Location
    Newport New VA
    MS-Off Ver
    Excel 2003
    Posts
    97

    Re: How to high entired row based on data in a cell

    Thanks stnkynts. for the quick reply. and I will check my spelling.

+ 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: 9
    Last Post: 08-07-2012, 07:57 AM
  2. Replies: 4
    Last Post: 01-18-2011, 10:47 AM
  3. Deleting Entired Rows Based on Data Conditions
    By starbwoy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-22-2008, 02:53 PM
  4. Sorting Data within cell low to high?
    By obnoxs32 in forum Excel General
    Replies: 5
    Last Post: 12-17-2007, 12:19 AM
  5. Sorting High to Low based on percent of total
    By Harold in forum Excel General
    Replies: 0
    Last Post: 04-05-2006, 12: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