M
mp
Is there a better way to do this?
Function LastRowOfData(oWs As Worksheet, Column As String) As Long
Dim currWs As Worksheet
Set currWs = ActiveSheet
oWs.Activate
Range(Column & "65536").End(xlUp).Select
Dim oCell As Range
Set oCell = ActiveCell
LastRowOfData = oCell.row
currWs.Activate
End Function
it works but looks like a terrible way to find that info to me?
thanks
mark
Function LastRowOfData(oWs As Worksheet, Column As String) As Long
Dim currWs As Worksheet
Set currWs = ActiveSheet
oWs.Activate
Range(Column & "65536").End(xlUp).Select
Dim oCell As Range
Set oCell = ActiveCell
LastRowOfData = oCell.row
currWs.Activate
End Function
it works but looks like a terrible way to find that info to me?
thanks
mark