+ Reply to Thread
Results 1 to 4 of 4

Searching for each cell in column A over another column in B

Hybrid View

  1. #1
    Registered User
    Join Date
    10-20-2014
    Location
    israel
    MS-Off Ver
    2010
    Posts
    2

    Question Searching for each cell in column A over another column in B

    Hello everyone,
    I have 2 columns in Excel which i want to check each row in column A for his identity in column B

    For example:
    Column A
    204345
    435643
    232435
    113435
    689842
    578324

    Column B
    5367885
    578324
    5972589
    1234844
    204345
    478771

    You can see that the value "204345" and "578324" in Column A have his identity in column B
    if its true, i want to make the font bold in column A. if not, dont make it bold.

    Can you help with that?
    Thanks!

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Searching for each cell in column A over another column in B

    Maybe:

    Sub moshiko17()
    Dim i As Long
    Dim y As Range
        For i = 2 To Range("A" & Rows.Count).End(3).Row
            Set y = Columns(2).Find(Cells(i, "A").Value, LookIn:=xlValues, lookat:=xlWhole)
                If Not y Is Nothing Then
                    Cells(i, "A").Font.Bold = True
                End If
            Set y = Nothing
        Next i
            
    End Sub

  3. #3
    Registered User
    Join Date
    06-25-2014
    Location
    Budapest, Hungary
    MS-Off Ver
    2007
    Posts
    40

    Re: Searching for each cell in column A over another column in B

    Alternative solution:
    Apply this to the relevant worksheet's code
    Sub Identify_yourself()
    
    Dim row_number_1 As String
    Dim row_number_2 As String
    row_number_1 = Cells(1, 1).End(xlDown).Row
    row_number_2 = Cells(1, 2).End(xlDown).Row
    For i = 1 To row_number_1
    For j = 1 To row_number_2
    If Cells(i, 1).Value = Cells(j, 2).Value Then
    Cells(i, 1).Font.Bold = True
    End If
    Next j
    Next i
    
    End Sub

  4. #4
    Registered User
    Join Date
    10-20-2014
    Location
    israel
    MS-Off Ver
    2010
    Posts
    2

    Re: Searching for each cell in column A over another column in B

    WOW guys you are incredible awesome !!
    thank you very much for your help.. !!!

+ 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. [SOLVED] searching a value using 2 cells in the row and 1 cell in column
    By zzblitzz in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-04-2013, 07:18 PM
  2. Replies: 1
    Last Post: 11-22-2012, 04:43 AM
  3. Replies: 3
    Last Post: 09-03-2012, 09:49 AM
  4. Searching for a cell value, return column
    By mdsickler in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-17-2011, 02:46 PM
  5. Searching an entire column for all the values existing in a nother column
    By Dynelor in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-18-2007, 06:20 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