Results 1 to 7 of 7

VBA Code - Compare Adjacent Cells In two columns...

Threaded View

  1. #1
    Registered User
    Join Date
    03-08-2012
    Location
    Notts
    MS-Off Ver
    Excel 2010
    Posts
    71

    Question VBA Code - Compare Adjacent Cells In two columns...

    This sounds so simple, but I am struggling to create code to do the following:

    On my spreadsheet, using VBA code, I want to compare 2 cells on the same row (adjacent) in the two columns: K and L

    If both cells contain the letter "C" I want that row to be hidden, then continue on to compare the next row and complete the same action.

    This process needs to start from row 17 until the last row.


    Any help would be appreciated...
    Thanks in advance!


    Just to add; so far I have tried this:

    Dim i As Long, n As Long
        n = Application.Max(Range("K65536").End(xlUp).Row, Range("L65536").End(xlUp).Row)
    
    For i = 17 To n
            If Range("K" & i).Value & Range("L" & i).Value = "C" Then
            Cells.Select
            EntireRow.Hidden = True
        End If
        Next i
    Last edited by arlu1201; 12-13-2012 at 06:38 AM.

Thread Information

Users Browsing this Thread

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

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