Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() How about something like this? Of course you can make the inputbox a specific cell or the activecell if you choose... that's just an example since you didn't specify. Hope that helps. Sub MyTest() Dim MyStr As String MyStr = InputBox("New Invoice:") Columns("A:A").Select Range("A1").Activate On Error GoTo NoDuplicate Selection.Find(What:=MyStr, LookAt:=xlWhole).Activate GoTo Duplicate Duplicate: 'Code for if duplicate is found Exit Sub NoDuplicate: 'Code for if NO duplicate is found Exit Sub End Sub delmac Wrote: Hi all, I've got a column of invoice numbers and each time I add one I want to make sure it it is not duplicated. I've tried using a function with copy/paste validation, but it doesn't always work as the invoices can be text as well as number. Any ideas. Thanks very much. -- delmac -- Ikaabod ------------------------------------------------------------------------ Ikaabod's Profile: http://www.excelforum.com/member.php...o&userid=33371 View this thread: http://www.excelforum.com/showthread...hreadid=542146 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Connecting of two data validating with each other | Excel Worksheet Functions | |||
validating data in a combobox | Excel Worksheet Functions | |||
avoid retype the number more than one time withen acolumn | Excel Discussion (Misc queries) | |||
Validating data in a spreadsheet control | Excel Programming | |||
Validating entered data as date | Excel Programming |