Results 1 to 19 of 19

VBA Code - Compare Adjacent Cells In two columns and clear contents when a match is found

Threaded View

Langer101 VBA Code - Compare Adjacent... 12-13-2012, 06:30 AM
Norie Re: VBA Code - Compare... 12-13-2012, 06:44 AM
Langer101 Re: VBA Code - Compare... 12-18-2012, 05:30 AM
Langer101 Re: VBA Code - Compare... 01-02-2013, 09:51 AM
Norie Where/how did you substitute... 01-02-2013, 09:57 AM
mike7952 Re: VBA Code - Compare... 01-02-2013, 10:10 AM
Langer101 Re: VBA Code - Compare... 01-03-2013, 02:52 AM
Norie What are the named ranges... 01-03-2013, 03:44 AM
Langer101 Re: VBA Code - Compare... 01-03-2013, 04:56 AM
Langer101 Re: VBA Code - Compare... 01-03-2013, 04:57 AM
Norie So what are they called? 01-03-2013, 04:57 AM
Langer101 Re: VBA Code - Compare... 01-03-2013, 05:00 AM
Norie That isn't a named range,... 01-03-2013, 05:11 AM
OllieB Re: VBA Code - Compare... 01-03-2013, 05:13 AM
Norie Re: VBA Code - Compare... 01-03-2013, 05:35 AM
Langer101 Re: VBA Code - Compare... 01-03-2013, 06:22 AM
OllieB Re: VBA Code - Compare... 01-03-2013, 05:46 AM
Langer101 Re: VBA Code - Compare... 01-03-2013, 06:01 AM
Norie Re: VBA Code - Compare... 01-03-2013, 06:12 AM
  1. #1
    Registered User
    Join Date
    12-04-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    34

    VBA Code - Compare Adjacent Cells In two columns and clear contents when a match is found

    Hi
    Just started on VBA and I need to compare 2 cells on the same row (adjacent) in the two columns (column names: "Title" and "Author")

    The only real difference is if both cells contain the SAME letters then, for the Author column, I want to clear the contents where there is a match, then continue on to compare the next row and complete the same action.

    Note:Its similar in nature to mtt23's thread on VBA Code - Compare Adjacent Cells In two columns

    Sub hide_cs()
    Dim n As Long
    n = 17 ' Started from row 17
    Do While Rows(n).Columns("K").Value <> ""
    If InStr(ucase(Rows(n).Columns("K").Value), "C") > 0 And InStr(ucase(Rows(n).Columns("L").Value), "C") > 0 Then Rows(n).EntireRow.Hidden = True
    n = n + 1
    Loop

    End Sub

    I've attached a sample file. Any Suggestions welcome!
    Attached Files Attached Files

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