我创建了这个函数:
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
当我在单元格中使用它时:
=getLastCellValue(1,"C")
Excel 告诉我该函数包含错误并关注第二个参数:"C"
.
我要疯了,因为我不明白这个错误。