Passing Arguments
can't use val as a variable - my typo - i meant it to be vVal
Sub LastRow()
Dim vVal as Long
vVal = FindLastRow ("A")
ActiveCell.Formula = vVal
End Sub
--
Regards,
Tom Ogilvy
"Tom Ogilvy" wrote in message
...
Sub LastRow()
val = FindLastRow ("A")
ActiveCell.Formula = val
End Sub
Public Function FindLastRow(cell) As String
Dim LastRow
LastRow = Range(cell & Rows.Count).End(xlUp).Row
FindLastRow = LastRow
End Function
--
Regards,
Tom Ogilvy
"Grant Reid" wrote in message
...
Hi
I have a routine that calls a function to determine the last row in a
range.
I need the function to return the last row number to the calling routine
which will place the number in the active cell.
Hope someone can help.
Sub LastRow()
FindLastRow ("A")
ActiveCell.Formula = ???????
End Sub
Public Function FindLastRow(cell) As String
Dim LastRow
LastRow = Range(cell & Rows.Count).End(xlUp).Row
End Function
Many Thanks - Grant
|