Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 89
Default How do I replace last numeric string from a alphanumeric string?

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

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How do I replace last numeric string from a alphanumeric string?


Hi,

Say

A1 = CC03TW05040000010001055428
B1 = 1162123

then enter C1

=LEFT(A5,LEN(A5)-LEN(B5))&B5

VBA Noob


--
VBA Noob
------------------------------------------------------------------------
VBA Noob's Profile: http://www.excelforum.com/member.php...o&userid=33833
View this thread: http://www.excelforum.com/showthread...hreadid=570561

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 89
Default How do I replace last numeric string from a alphanumeric string?



Bingo!
Thanks a lot guys. You guys are incredible.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
random alphanumeric string [email protected] Excel Worksheet Functions 4 April 21st 23 09:04 AM
Numeric cell but shows as string? Brett Excel Worksheet Functions 9 March 24th 05 12:56 PM
Summing part of an Alpha Numeric String Arturo Excel Worksheet Functions 2 February 23rd 05 10:59 PM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 01:37 AM
Extracting numeric values from string RJF Excel Worksheet Functions 3 January 5th 05 11:48 PM


All times are GMT +1. The time now is 10:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"