Hello everyone! I'm new to the forum, but have been using it for many of my projects over the past few months. In the company i work for we cannot get Microsoft Access so I am basically circumventing this issue and creating our own database using multiple excel files. There are about 12 files talking to each other, and so far the only issue i have run into was the below. Since i can't search tab names easily, I just am opening the database, and then the tab based on user input which will be a machine's serial number. The database will have a separate sheet for each machine that is QC tested, and where I've run into an issue is in the error. Instead of returning the error message I want, I get "Subscript out of range (Error 9)".
Sub Database_Search()
If Range("B9").Value = "SXD2010A-M" Then
userinput = InputBox("Enter Serial Number: ")
'A20 is set as a text field
Range("A20").Value = userinput
Set A = Range("A20")
'Open database
Workbooks.Open "C:\Documents and Settings\...etc"
'Open up sheet based on input field
Sheets(A.Value).Activate
'On error show msg box "Not in Database"
On Error GoTo ErrorHandler
Exit Sub
Else
End If
ErrorHandler:
MsgBox ("Not in Database")
End Sub
Bookmarks