Hi DB,
You need to make the FindLastRow sub into a function. I've knocked one together and done a quick test - have a go and change to suit.
<pre>Function FindLastRow(wbkFullPath As String, wksName As String) As Long
On Error GoTo NoWBK
Workbooks.Open (wbkFullPath)
On Error GoTo 0
On Error GoTo NoWKS
With ActiveWorkbook.Worksheets(wksName)
On Error GoTo 0
If WorksheetFunction.CountA(Cells) > 0 Then
'Search for any entry, by searching backwards by Rows.
FindLastRow = Cells.Find(What:="*", After:=[A1], _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
End If
End With
Exit Function
NoWBK:
MsgBox "Workbook not found!"
Exit Function
NoWKS:
MsgBox "Worksheet not found!"
Exit Function
End Function
Sub Test()
Dim LastRow As Long, wbkFullPath As String, wksName As String
wbkFullPath = "C:My DocumentsSpreadsheetsEntDate Save Test.xls"
wksName = "Sheet1"
LastRow = FindLastRow(wbkFullPath, wksName)
MsgBox LastRow
End Sub</pre>
HTH