如何使它成为一个函数,以便我可以将“B38”作为变量传递?我尝试将“startCell”放在 range 函数中,但它失败了,我不清楚要完成这项工作需要什么......
TIA
Set startCell = Range("B38")
For i = 0 To 6
hourVal = Worksheets("Expense & Hours").Range("b38").Offset(0, i).Value
dateVal = Worksheets("Expense & Hours").Range("b38").Offset(2, i).Value
MsgBox "Current: " & hourVal & " " & dateVal
Next i