If you want to return a Range object using dynamic end row determination you will need to specify the function return as Range object and pass a start row variable and column number to use, in addition to using a last row method.
Option Explicit
Public Sub test()
Dim ws As Worksheet, rng As Range
Set ws = ThisWorkbook.Worksheets("Sheet1")
Set rng = GetRange(ws, 1, 1)
Debug.Print rng.Address
End Sub
Public Function GetRange(ByVal ws As Worksheet, ByVal startRow As Long, ByVal columnNumber As Long) As Range
With ws
Set GetRange = Range(.Cells(startRow, columnNumber), .Cells(.Cells(.Rows.Count, columnNumber).End(xlUp).Row, columnNumber))
End With
End Function
You probably want some error handling/test that the determined end row is not less than the startRow e.g. with lastRow as 3 and startRow = 4
Option Explicit
Public Sub test()
Dim ws As Worksheet, rng As Range
Set ws = ThisWorkbook.Worksheets("Sheet1")
Set rng = GetRange(ws, 4, 1)
If Not rng Is Nothing Then Debug.Print rng.Address
End Sub
Public Function GetRange(ByVal ws As Worksheet, ByVal startRow As Long, ByVal columnNumber As Long) As Range
Dim lastRow As Long
With ws
lastRow = .Cells(.Rows.Count, columnNumber).End(xlUp).Row
If Not lastRow < startRow Then
Set GetRange = .Range(.Cells(startRow, columnNumber), .Cells(lastRow, columnNumber))
End If
End With
End Function