title: VBA String Comparison with a return carriage
body: <p>I am trying to compare 2 strings to find a match.
  The code opens many files and for each file it fetches 2 strings that 
  supposedly match to the ones I defined. 
  However, one of the strings in a cell contains a carriage return and this is 
  the reason why I can't seem to get a match.
  Your help will be truly appreciated!
  Thanks in advance.</p>
  
  <p>The related parts of my code for the comparison are the following: </p>
  
  <pre><code>Dim i As Integer
  Dim a, WScount, rows, j As Integer
  Dim temp As String
  Dim check1, check2 As Boolean
  Dim str1, str2 As String
  
  i = 1
  j = 1
  
  str1 = "Manufacturers Number"
  str2 = "Manufacturers" &amp; vbCrLf &amp; " Number"
  
  For Each WS In Worksheets
      N = 0
      rows = 1
      While N &lt; 7
          temp = src.ActiveSheet.Cells(rows, 2)
          check1 = StrComp(str1, temp, vbTextCompare)
          check2 = StrComp(str2, temp, vbTextCompare)
          If check1 = 0 Or check2 = 0 Then
              For k = rows + 1 To 100
                  temp = Cells(k, 2)
                  If Not StrComp("", temp, vbTextCompare) = False Then
                      ThisWorkbook.Worksheets(1).Cells(j, 3) = temp
                      j = j + 1
                  End If
              Next k
          End If
              rows = rows + 1
              N = N + 1
      Wend
  
  Next WS
  </code></pre>