Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy only the numbers from cells

I have some table that in one column I have some strings (for example):
"Sum : 148,626.35 Better and different"
"Sum : 193,500.00 Osem"

I want only the number will be copy to another column.

How do I do that

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Copy only the numbers from cells

Hi,

Write this code in a module you insert to your workbook
using VB Editor.

Public Function texttrim(a As String) As Double
Dim b As String
For i = 1 To Len(a)
If Asc(Mid(a, i, 1)) 43 And Asc(Mid(a, i, 1)) < 58 Then
b = b + Mid(a, i, 1)
Next
texttrim = b
End Function

This will make a new worksheet function =texttrim()
available in your workbook which does exactly what you
need. For example if the text to be trimmed is in cell A1,
enter =texttrim(A1) to any other cell and you will get
just the number.

Regards,

-----Original Message-----
I have some table that in one column I have some strings

(for example):
"Sum : 148,626.35 Better and different"
"Sum : 193,500.00 Osem"

I want only the number will be copy to another column.

How do I do that ?


---
Message posted from http://www.ExcelForum.com/

.

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
Copy and pasted numbers not acting like numbers mklapp Excel Discussion (Misc queries) 1 May 15th 09 02:28 PM
Copy and paste versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
sort numbers high to low, copy to new cells with associated data. ucastores Excel Worksheet Functions 3 September 3rd 06 02:13 PM
copy numbers from numbers+text cell Henk Excel Worksheet Functions 3 August 11th 06 02:48 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM


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

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"