I've created this function:
Public Function getLastCellValue(ByVal row As Integer, ByVal column As String) As String
If (Cells(row, column).Value = "") Then
getLastCellValue = getLastCellValue(row - 1, column)
Else: getLastCellValue = Cells.Item(row, column).Value
End If
End Function
When I use it in a cell this:
=getLastCellValue(1,"C")
Excel tells me that the function contains an error and focuses on the second parameter: "C"
.
I'm going crazy because I do not understand the mistake.