title: Run time error 1004 when trying to find row
body: <p>was wondering if anyone could help me solve the following problem.
   I'm given a runtime error 1004, over at <code>With Worksheets("Sheet1").Cells(Rowtosave, EGCheck)</code> Have spent quite some time trying out but still unable to define the error myself. Should anyone nice, care to help me out? Will appreciate your help. Thanks!</p>
  
  <pre><code>Sub Macro1()
  
  Dim LastRow1 As Long, RowCheck As Long, Rowtosave As Long, LastCol1 As Long
  Dim EGCheck As Long, ColEG As Range, firstEG As Long
  
  
  LastRow1 = 50
  LastCol1 = 50
  
     For RowCheck = 1 To LastRow1
  'Look for "Name"
       With Worksheets("Sheet1").Cells(RowCheck, 1)
           If .Value = "Name" Then
       'Set row to Rowtosave for later use
             Rowtosave = RowCheck
  
           End If
      End With
  
   Next RowCheck
  
       For EGCheck = 1 To LastCol1
        'Look for EG on the name row with varying column
        'Since already obtain the row for name as Rowtosave, so set Row to Rowtosave
          With Worksheets("Sheet1").Cells(Rowtosave, EGCheck)
            If .Value = "EG" Then
  
             firstEG = EGCheck
  
           End If
         End With
  
  Next EGCheck
  </code></pre>