Consulting

Results 1 to 2 of 2

Thread: Delete ** in end of each cell of right

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

    Question Delete ** in end of each cell of right

    I have about 46000 cell in column D that some of them ** in end of each data like Orange** or 1234** now I need a VBA code that can delete these 2 star . also I have some data like this : 3424** RMP3232 I do not want delete the star of these data .

    Thank you very much .

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    [VBA]Sub DelAsterisk()
    Dim cel As Range
    For Each cel In Selection
    If Right(cel, 2) = "**" Then cel.Value = Left(cel, Len(cel) - 2)
    Next
    End Sub[/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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