Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Remove and Add Text to Numbers

for VBA
MyString
VAL(mid(MyString,2,Instr(MyStr," ")-1))


Just to point out to the OP... I'm guessing you meant to write MyString
whereas you wrote MyStr instead.

By the way, here is another what to get the number out in VBA...

--Mid(Split(MyString)(0),2)

Although if the "code number" in the front is always constructed as shown,
you could get the number portion directly....

--Mid(MyString,2,5)

Rick

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
Easiest way to remove text from a cell that has text and numbers? [email protected] Excel Discussion (Misc queries) 2 August 17th 06 06:07 PM
remove text from cell containing numbers Tim Excel Discussion (Misc queries) 2 March 22nd 06 02:30 PM
How can I remove diff. numbers from a cell combined with text Greg Excel Discussion (Misc queries) 5 February 28th 06 07:57 PM
Remove Numbers from text David Excel Worksheet Functions 6 May 2nd 05 12:44 AM
Remove leading Numbers from text DBLWizard Excel Worksheet Functions 2 March 31st 05 11:08 PM


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

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

About Us

"It's about Microsoft Excel"