Solved

Excel 2010 Remove characters vba

Posted on 2014-11-06
2
239 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

828 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