title: Error 1004 Vlookup VBA
body: <p>I have yet again another question to ask regarding VBA. I'm currently trying to use the VLookUp function. Here is all the information relevant  to the code:</p>
  
  <pre><code>Dim Template_Sheet As Worksheet
  Dim Database_Sheet As Worksheet
  Dim Source_Sheet As Worksheet
  Dim FileUpdate As Worksheet
  
  Set Template_Sheet = Sheets("Template")
  Set Database_Sheet = Sheets("Database")
  Set Source_Sheet = Sheets("Source")
  Set FileUpdate = Sheets("NewFile")
  
  Dim Database_Row_Count As Integer
  Dim Database_Column_Count As Integer
  Dim id_temp As String
  Dim Row_Count As Integer
  Dim Lat_Index As Integer
  
  For i = 1 To FileUpdate.Rows.Count 'Count Rows
     If IsEmpty(FileUpdate.Cells(i, 1)) Then
          Row_Count = i - 1
          Exit For
      End If
  Next i
  
  Lat_Index = Source_Sheet.Cells(6, 1).Value
  Database_Row_Count = Source_Sheet.Cells(6, 4).Value
  Database_Column_Count = Source_Sheet.Cells(6, 5).Value
  
  For i = 2 To (1 + Row_Count)
  id_temp = Template_Sheet.Cells(i, 1).Value
  
  Template_Sheet.Cells(i, 2).Value = Application.WorksheetFunction.VLookup(id_temp, Database_Sheet.Range(Database_Sheet.Cells(2, 1), Database_Sheet.Cells(Database_Row_Count, Database_Column_Count)), Lat_Index, False)
  
  Next i
  </code></pre>
  
  <p>I get, you guessed it, Error 1004 on run. I've used almost all of these values for other applications within the sub, so I suspect my error must be coming from a miss-defined parameter when calling the VLookup function. Help is much appreciated. </p>
  
  <p>Thanks! 
  D.</p>