Conversation Between JBeaucaire and adeleex

1 Visitor Messages

  1. Hi,

    I found a brilliant post you left a few years ago via Google to add a prefix to numbers entered, the code you suggested was:
    ______________________________________________________

    Option Explicit

    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
    ______________________________________________________

    Could you tell me how the code could be amended to ensure the XX disappears when the number is deleted?

    Many thanks,

    Adele
Showing Visitor Messages 1 to 1 of 1

Search Engine Friendly URLs by vBSEO 3.2.0