Thread: [Solved] Data entry asistance needed
View Single Post
 
Old 09-06-2014, 06:11 AM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The following should work

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim oRng As Range
    Set oRng = Range("A:A")
    If Target.Cells.Count > 1 Or Target = "" Then Exit Sub
    If Not Intersect(Target, oRng) Is Nothing Then
        If IsNumeric(Target) Then
            On Error Resume Next
            Application.EnableEvents = False
            Target = "BC102014" & CStr(Target)
            Application.EnableEvents = True
            On Error GoTo 0
        Else
            MsgBox "Not a valid number"
            Target.Select
            Target = ""
        End If
    End If
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote