Consulting

Results 1 to 3 of 3

Thread: Solved: Add MS- and delete the 3 of first number

  1. #1
    VBAX Mentor
    Joined
    Feb 2012
    Posts
    406
    Location

    Question Solved: Add MS- and delete the 3 of first number

    I need a VBA code that add MS- to first of cell and delete the 3 first of numbers like :
    12345678 = MS-45678
    87452168 = MS-52168
    1234567 = MS-4567
    123456 = MS-456
    12345 = MS-45
    Please help me .

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [VBA]
    For Each cell In Range("A1:A5")

    cell.Value="MS-" & Right$(cell.Value, Len(Cell.Value) - 3)
    Next cell[/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Mentor
    Joined
    Feb 2012
    Posts
    406
    Location
    Thank you very much for your help .

Posting Permissions

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