I have three functions .
The main function which gets called from Workbook is "getRefi"| (as given below).
it s second line - SecuredLastRange = getLastValueInList(SecuredFirstRange) - throws the error, Can you please tell me what is worng in my VBA code ?
Public Function getRefi(rownum As Integer) As String
SecuredFirstRange = Sheets("Data").Range("K5")
SecuredLastRange = getLastValueInList(SecuredFirstRange) -- This line throws , ByRef Argument Type mismatch
End Function
Public Function getLastValueInList(TimeBucketData As Range) As Range
Do While hasNextRow(TimeBucketData)
TimeBucketData = TimeBucketData.Offset(1, 0)
Loop
getLastValueInList = TimeBucketData
End Function
Public Function hasNextRow(rownum As Range) As Boolean
If rownum.Offset(1, 0) <> "" Then
hasNextRow = False
Else
hasNextRow = True
End If
End Function
Bookmarks