maybe his will be more explanatory
Function don't need to ne called and usually return values
Code:
Option Explicit
Dim nrow As Long
Public Function Lastrow() As Long
'Function finding the last row in active worksheet with data
Lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
nrow = Lastrow ' populate nrow
End Function
Public Function Farcol() As String
'Function finding the Far Column in active worksheet with data
Dim ncol As Long
ncol = ActiveSheet.UsedRange.Columns.Count
Farcol = Split(Cells(1, ncol).Address(True, False), "$")(0)
End Function
Sub Display_LastCell()
'Display the last cell with data using Function
MsgBox "Row = " & Lastrow() & " Column = " & Farcol()
End Sub
Sub Display_nrow()
'Display the last cell with data using nrow variable
MsgBox " nrow = " & nrow
End Sub