Results 1 to 6 of 6

Letter prefix to numbers

Threaded View

  1. #1
    Registered User
    Join Date
    08-18-2010
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    28

    Letter prefix to numbers

    Hi,

    I found this code from a previous post from a few years back which allows you to add a prefix to numbers you enter, does anyone know how to amend it so you can delete the ‘XX’ as it remains 'stuck' even after removing the number?

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim cell As Range
    Application.EnableEvents = False
    
    For Each cell In Target
        If Not Intersect(cell, Range("A:A")) Is Nothing Then _
            If IsNumeric(cell) Then cell = "XX" & cell.Value
    Next cell
    
    Application.EnableEvents = True
    End Sub
    Many thanks,

    Adele
    Last edited by adeleex; 08-23-2011 at 05:49 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1