PC Review


Reply
Thread Tools Rate Thread

Capture a number from a cell containing numbers and letters

 
 
Khurram
Guest
Posts: n/a
 
      23rd Jan 2007
Hi all,
I need to capture the number from a cell that contains data in the
format "2.45 Days" or "3.6 Days". Is it possible to somehow remove the
"Days" elements and capture all else? I am doing this programatically
using VBA.

Thank you kindly

Khurram

 
Reply With Quote
 
 
 
 
Ron Rosenfeld
Guest
Posts: n/a
 
      23rd Jan 2007
On 23 Jan 2007 10:04:20 -0800, "Khurram" <(E-Mail Removed)> wrote:

>Hi all,
>I need to capture the number from a cell that contains data in the
>format "2.45 Days" or "3.6 Days". Is it possible to somehow remove the
>"Days" elements and capture all else? I am doing this programatically
>using VBA.
>
>Thank you kindly
>
>Khurram


So long as the format is as you show, with the numeric value coming first, the
Val function will return only the number:

e.g.

Debug.Print Val("3.6 days")
--> 3.6


--ron
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom number format code using letters and numbers Foo Foo Daddy Microsoft Excel Worksheet Functions 3 17th Aug 2009 03:59 PM
How to extract numbers from letters in cell? ghost Microsoft Excel Misc 2 6th Aug 2008 12:21 PM
Seperate letters and numbers in a cell Keith S Microsoft Excel Programming 6 9th Feb 2008 09:40 AM
Expanding numbers and letters in a cell tbriggs Microsoft Excel Misc 4 15th Sep 2006 01:44 PM
VLOOKUP for a cell with both letters and numbers =?Utf-8?B?U29ub2hhbA==?= Microsoft Excel Misc 6 8th Apr 2005 02:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:59 PM.