Solved

Excel 2010 Remove characters vba

Posted on 2014-11-06
2
244 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

724 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