PDA

View Full Version : Delete ** in end of each cell of right



parscon
04-01-2013, 06:26 AM
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 .

mdmackillop
04-01-2013, 07:34 AM
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