Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
saziz
 
Posts: n/a
Default Numerical values only


Hi,
How can I transfer from one cell to other only numerical values.
Like in one cell I have "sun rise time 06:15" I want in adjecent cell
only 06:15
Pleae help.
thanks
Saziz


--
saziz
------------------------------------------------------------------------
saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=523269

  #2   Report Post  
Posted to microsoft.public.excel.misc
Pete_UK
 
Posts: n/a
Default Numerical values only

If your data is always like that, i.e. time information occupying the
last 5 characters of the string, then you can do this, assuming the
data is in cell A1:

=VALUE(RIGHT(A1,5)&":00")

and format the cell with the formula in as hh:mm.

Hope this helps.

Pete

  #3   Report Post  
Posted to microsoft.public.excel.misc
Niek Otten
 
Posts: n/a
Default Numerical values only

You could use this User defined Function.

If you're new to VBA, read this first:

http://www.mvps.org/dmcritchie/excel/getstarted.htm


The function:

' ================================================== ===========================

Function StripTxt(a As String) As String

' Strips all non-numeric characters from a string, but leaves colons

' Returns a string, not a number!

Dim i As Long

Dim b As String

For i = 1 To Len(a)

b = Mid$(a, i, 1)

If ((Asc(b) 47 And Asc(b) < 58) Or b = ":") Then StripTxt = StripTxt + b

Next i

End Function

' ================================================== ===========================


--
Kind regards,

Niek Otten




"saziz" wrote in message
...

Hi,
How can I transfer from one cell to other only numerical values.
Like in one cell I have "sun rise time 06:15" I want in adjecent cell
only 06:15
Pleae help.
thanks
Saziz


--
saziz
------------------------------------------------------------------------
saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=523269



  #4   Report Post  
Posted to microsoft.public.excel.misc
saziz
 
Posts: n/a
Default Numerical values only


Thank you Niek Otten and Pete_UK both the suggestions worked perfectly.
Saziz


--
saziz
------------------------------------------------------------------------
saziz's Profile: http://www.excelforum.com/member.php...fo&userid=6350
View this thread: http://www.excelforum.com/showthread...hreadid=523269

  #5   Report Post  
Posted to microsoft.public.excel.misc
Pete_UK
 
Posts: n/a
Default Numerical values only

Thanks for feeding back.

Pete

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
Associated Numerical Values kdoggity Excel Discussion (Misc queries) 3 February 24th 06 07:07 PM
Return Range of Numerical Values in Single Column based on Frequency Percentage Sam via OfficeKB.com Excel Worksheet Functions 9 October 28th 05 11:01 PM
How can I break values apart that are in the same cell? Phil Excel Worksheet Functions 3 October 4th 05 03:41 PM
Assign numerical values to text codes Bridget Excel Worksheet Functions 3 April 18th 05 11:33 PM
How do I stop excel replacing numerical values with the date? Becca C Excel Discussion (Misc queries) 2 December 21st 04 12:12 PM


All times are GMT +1. The time now is 05:18 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"