Private Sub CommandButton1_Click()
Dim f$, th$
th = ThisWorkbook.Path & "\" & [c8].Value & "\"
f = Dir(th & [c6].Value & "*.xls*")
If Len(f) Then
Workbooks.Open (th & f)
Else
MsgBox "文件不存在!"
End If
End Sub
此代码是根据表C6文件夹名称,C8工作表名称超连接到指定目录下的指定工作表。
我想设个:当表一B5=表二C5时才超连接到指定目录下的工作表,不等时提示“与表二不符”。
请各位帮忙,谢谢!