title: VBA check for value in a range
body: <p>I am trying to loop through a column and if cells = "what i'm lookng for" then do something.
  I have this so far, where I'm off is in the if statement where I check for the "name":</p>
  
  <pre><code>Option Explicit
  
  Sub test()
  
  Dim wksDest             As Worksheet
  Dim wksSource           As Worksheet
  
  Dim rngSource           As Range
  
  Dim name                 As String
  
  Dim LastRow             As Long
  Dim LastCol             As Long
  Dim c                   As Long
  
  Application.ScreenUpdating = False
  
  Set wksSource = Worksheets("Sheet1")
  
  With wksSource
  LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
  For c = 16 To 20
  LastRow = .Cells(.Rows.Count, c).End(xlUp).Row
  Set rngSource = .Range(.Cells(5, 16), .Cells(LastRow, 16))
  name = rngSource.Value
  
  If name = "mark"
  do something 
  End If
  
  Next c
  End With
  
  Application.ScreenUpdating = True
  
  'MsgBox "Done!", vbExclamation
  
  End Sub
  </code></pre>