当找不到文件 TestData.xlsx 时,我希望 msgbox 显示“找不到文件”。谢谢
Sub check()
Dim i As Long
'~~> From Row 5 to row 10
'~~> Chnage as applicable
For i = 5 To 10
Sheets("Sheet1").Range("F" & i).Formula = _
"=VLookup((CONCATENATE(C1,"" "",C" & i & _
")),'C:\Documents[TestData.xlsx]Sheet1'!$A$2:$G$28,7, FALSE)"
Sheets("Sheet1").Range("F" & i).Value = Sheets("Sheet1").Range("F" & i).Value
Next i
End Sub