Solved

Excel 2010 Remove characters vba

Posted on 2014-11-06
2
235 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
Comment Utility
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
Comment Utility
Fantastic! Thank you very much
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Lately there has been a variety of news related to U.S. employment.  Stories about worker productivity, automobile and airline unions, low employment and foreign laborers have frequented the news.  Each story has good and bad attributes we might arg…
Today companies are subjected to more-and-more data, and it won't stop any time soon.  But there are obvious opportunities for reducing data, particularly data duplicated among companies.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

771 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

11 Experts available now in Live!

Get 1:1 Help Now