Hi all,
I'm trying to open the workbook base on Cell value and I would like to open MsgBox and close UserForm if the file does not exsit.
Regards,
tt3
Private Sub tt3_Click()
Sheets("Sheet1").Range("N2").Value = UserForm.TextBox2.Value
If Sheets("Sheet1").Range("N2").Value = False Then
MsgBox "Please enter Vehicle info"
UserForm.Hide
End If
If Not "Y:\Testing\" & ThisWorkbook.Sheets("Sheet1").Range("N2").Value & ".xlsm" Then
MsgBox " This Vehicle does not exist "
UserForm.Hide
End If
Else
Workbooks.Open Filename:="Y:\Testing\" & ThisWorkbook.Sheets("Sheet1").Range("N2").Value & ".xlsm"
UserForm.Hide
End Sub
Bookmarks