本帖最后由 hasyh2008 于 2022-6-6 18:38 编辑
点击B2,打开A2文件,类推。
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim FilePath$
FilePath = ThisWorkbook.path & "\A\"
With Target
If .Column = 2 And .Row > 1 And .Row < 5 Then
Shell "RUNDLL32.EXE URL.DLL,FileProtocolHandler " & FilePath & .Offset(0, -1).Text, vbMaximizedFocus
End If
End With
End Sub