Hi
hope this will get you started
Sub test()
Dim nbr As Variant, r As Range, test As Boolean
nbr = InputBox("Enter the number")
If Len(nbr) = 0 Then Exit Sub
If Not IsNumeric(nbr) Then
MsgBox "Improper input"
Exit Sub
End If
test = False
For Each r In Range("a1", Range("a65536").End(xlUp))
If r.Value = nbr Then
test = True
Exit For
End If
Next
If test = True Then
MsgBox nbr & vbLf & "Already exists"
Else
Range("a65536").End(xlUp).Offset(1).Value = nbr
MsgBox "Added new number to the list: " & nbr & vbLf & "Thank you!"
End If
End Sub
rgds,
jindon
Bookmarks