I have shown below a small part of code that I use for creating new worksheets. It ask's the user for all of the data that needs to be shown on the new sheet.
I need to add something to the above code for the first input box (door number) by which Column C, in a sheet called 'Database' will be checked to see if the entered number already exists. If the number has already been used, then everything messes up further down the line.
If the number entered already exists, I need an 'OK' box telling the user that the number they tried is already in use, and then the same input box for the user to try a different number. It would also be good if there could be a 'cancel' button to end sub if user doesn't have a unique number to use....
Hope that makes sense? Thanks in advance
Code:
Sheets("NewSheetInfo").Select
Range("c3").Select
ActiveCell.Value = InputBox("Door Number?")
Range("d3").Select
ActiveCell.Value = InputBox("Location on Site?")
Range("e3").Select
ActiveCell.Value = InputBox("Door Type?")
Range("f3").Select
ActiveCell.Value = InputBox("Manufacturer?")
Range("g3").Select
ActiveCell.Value = InputBox("Motor Type?")
Range("h3").Select
ActiveCell.Value = InputBox("Operation - Electric/Manual/Automatic ?")
Range("i3").Select
ActiveCell.Value = InputBox("Usage? High or Low")
I need to add something to the above code for the first input box (door number) by which Column C, in a sheet called 'Database' will be checked to see if the entered number already exists. If the number has already been used, then everything messes up further down the line.
If the number entered already exists, I need an 'OK' box telling the user that the number they tried is already in use, and then the same input box for the user to try a different number. It would also be good if there could be a 'cancel' button to end sub if user doesn't have a unique number to use....
Hope that makes sense? Thanks in advance