View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
KP[_4_] KP[_4_] is offline
external usenet poster
 
Posts: 43
Default Delete characters from behind if too many

Hi,

Thank you for your suggestion. It almost does the job but not quite.

In order to start the deletion of characters from the end of the word I
changed "Right" to "Left", but the code is not able to deal with words
containing e.g. 12 characters in which case I want only the last two
characters to be deleted.

I hope a minor change can solve this little problem.

Regards,
Kaj Pedersen




"isabelle" skrev i en meddelelse
...
hi,

For Each c In Range("A1:A10")
If Len(c) 10 Then Range(c.Address) = Right(c, Len(c) - 10)
Next

--
isabelle



Le 2011-10-11 08:36, KP a écrit :
Hi,

I want to search a range for words and numbers with more than e.g. 10
characters/digits and delete from behind until 10 characters is reached.

Is this possible?

Best regards,
Kaj Pedersen