Results 1 to 2 of 2

Compare values in column a to column b, and put it in column c if they match

Threaded View

  1. #1
    Forum Contributor
    Join Date
    07-17-2012
    Location
    N/A
    MS-Off Ver
    Excel 2010
    Posts
    218

    Compare values in column a to column b, and put it in column c if they match

    i'm trying to compare a value from column a to every value in column b, if they match, then copy that value to column c

    right now i have a function that will check column b and return a true/false if you send it a value to match it
    trying to figure out how i can run a function in to then take the true/false function and copy the first column value to column c

    any help would be appreciated

    thanks
    Function IsInListB(theWord As String)
        'it returns true if a match is found
        'it returns false if a match is not found
            
        Dim isMatch As Boolean
        isMatch = False                         'assuming not in list at the beginning
            
        Range("B2").Select
        Do While ActiveCell.Value <> ""         'continue checking as long as column B is not blank
            If ActiveCell.Value = theWord Then  'got a match
                isMatch = True                  'so set isMatch to true
            End If
            ActiveCell.Offset(1, 0).Select      'go down one cell in column B
        Loop
        
        IsInListB = isMatch                     'send true or false to calling sub procedure
        
    End Function
    Attached Files Attached Files
    Last edited by lesoies; 04-26-2013 at 07:55 PM.

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