Solved

Excel 2010 Remove characters vba

Posted on 2014-11-06
2
237 Views
Last Modified: 2014-11-06
I have a very simply spread sheet. Starting in column a2 I scan a barcode that returns a result of ABC12345. The cursor then goes into a3 to scan my next barcode which will be abc55555 and so on. All the barcodes will begin with ABC. What I would like to happen is when scanning the barcode ABC is removed to just show the number (12345).  I want this to happen automatically not using something like =RIGHT(A2, LEN(A2)-3. It seems when I try this It does not change my result.

Any help is appreciated.
0
Comment
Question by:tmaususer
2 Comments
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40426591
Put this in the VBA code for that Sheet (not in a module).

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
    If Left(Target.Value, 3) = "ABC" Then
        Target.Value = Mid(Target.Value, 4, 9999)
    End If
End If
End Sub

Open in new window

0
 

Author Closing Comment

by:tmaususer
ID: 40426602
Fantastic! Thank you very much
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now