View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Zamdrist Zamdrist is offline
external usenet poster
 
Posts: 10
Default How do I replace last numeric string from a alphanumeric string?

Christy wrote:
For example,
I want to replace "1055428" from CC03TW05040000010001055428 with "1162123",
so that my string would be CC03TW05040000010001162123.

Thanks!


Is the last set of characters consistently 7 characters? If so...

sString = Left("CC03TW05040000010001055428",
Len("CC03TW05040000010001055428") -7) & "1162123"

"1162123" could be a variable or a field value too.

If it is not consistently 7 characters...maybe 1000 is? In which case
you could use the Mid function.

Steve