Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Capture a number from a cell containing numbers and letters

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Capture a number from a cell containing numbers and letters

On 23 Jan 2007 10:04:20 -0800, "Khurram" 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
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
custom number format code using letters and numbers Foo Foo Daddy Excel Worksheet Functions 15 December 26th 16 12:33 PM
How can I sum just numbers in a cell using letters or others symbo JCPS Excel Worksheet Functions 4 August 12th 08 12:42 AM
How to extract numbers from letters in cell? ghost Excel Discussion (Misc queries) 2 August 6th 08 12:21 PM
Expanding numbers and letters in a cell tbriggs Excel Discussion (Misc queries) 4 September 15th 06 01:44 PM
Capture first 2 letters from a product code stumped Excel Worksheet Functions 2 May 18th 05 07:19 PM


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

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"