+ Reply to Thread
Results 1 to 13 of 13

Comparing Words in Cell and Showing Difference

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-10-2007
    MS-Off Ver
    Excel 2010
    Posts
    293

    Re: Comparing Words in Cell and Showing Difference

    Richard,

    You're right. My bad. Now for column d, where I want to show the matching words, is there a way to do this in all one script?

    BTW..thanks to both of you. Really apprecaited.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Comparing Words in Cell and Showing Difference

    A small modification to Martin's code will do it.

    Function SameWords(A As Range, B As Range) As String
    AArray = Split(LCase(A), " ")
    BArray = Split(LCase(B), " ")
    For AWord = 0 To UBound(AArray)
        If Len(AArray(AWord)) > 0 Then
            AWordNew = True
            For BWord = 0 To UBound(BArray)
                If AArray(AWord) = BArray(BWord) Then
                    AWordNew = False
                    Exit For
                End If
            Next BWord
            If AWordNew = False Then 'True Then
                SameWords = SameWords & AArray(AWord) & ","
            End If
        End If
    Next AWord
    If Len(SameWords) > 0 Then SameWords = Left(SameWords, Len(SameWords) - 1)
    End Function
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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. Comparing two Cell containing Number and giving the difference in third cell
    By aabhi2251 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-22-2014, 10:34 AM
  2. Difference from not showing up when filtered
    By mga8402 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 08-07-2013, 06:51 PM
  3. Showing difference as a percentage
    By oliver79 in forum Excel General
    Replies: 1
    Last Post: 07-06-2010, 06:29 AM
  4. Showing a difference between values
    By MattG in forum Excel General
    Replies: 9
    Last Post: 09-14-2009, 05:02 PM
  5. showing difference value with out going over ref cell
    By aprils280zx in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-04-2007, 07:33 PM

Tags for this Thread

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