title: VBA search each cell iteratively for a string
body: <p>I'm working on equipment databases for my job, and I'm trying to search for a variable string in each cell of a column, and once that string is found, I need to assign another variable to the value of the cell in the column next to the column I'm searching.
  I can perform loops and iterations and if statements, however I'm having a hard time finding a function that would allow me to search specific cells for a string. </p>
  
  <p>Is there any way to specify a search of a cell, sort of like Cells(x,y).find()etc.  or does that not exist?  Also, I've found a lot of documentation on the InStr() function, but that only counts the number of times a string appears in a column, right?  Is there any way to return the row,col numbers of cells that the string is found in?  Thank you for any help you can offer. </p>
  
  <pre><code>Sub Trans()
  Dim A As Range, r As Range, s As String
  
  Set A = Range("A2:A11")
  
  s = "T1"
  
  For Each r In A
      If InStr(1, r.Value, s) &gt; 0 Then
          i = r.Row
          Cells(i, C) = "here"
      End If
  
  Next r
  
  End Sub        
  </code></pre>