All,
I have a Input Box Macro that adds names to a table. The column of the table is a named range "CrewDescriptions". I'm trying to check my input box variable against the Named Range "CrewDescriptions" for any duplicates and if so End Sub before it try's to enter the duplicate information.
Any Ideas?
I have a Input Box Macro that adds names to a table. The column of the table is a named range "CrewDescriptions". I'm trying to check my input box variable against the Named Range "CrewDescriptions" for any duplicates and if so End Sub before it try's to enter the duplicate information.
VBA Code:
'Crewat New Crew
Sub BLC_NewCrew()
'declare variable to hold value returned by InputBox
Dim myInputBoxVariable As String
'Create InputBox, and assign value returned by InputBox function to variable
myInputBoxVariable = InputBox(Prompt:="New Crew Name:", Title:="Excel InputBox", Default:="-")
If myInputBoxVariable = "" Then Exit Sub
' If myInputBoxVariable = a value that already exists in named range "CrewDescriptions" Then Exit Sub
' Rest of Code
Any Ideas?