Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 70
Default formula

i dont know how to make macro as iam new. so pls explain me step by step.i
think its in visul basic. pls help

"Gord Dibben" wrote:

A macro to delete all but numerics.

If you wish to retain the source cells, make a copy of the data in an adjacent
column and run the macro on that column.

Sub RemoveAlphas()
' Remove alpha characters from a string.
' except for decimal points and hyphens.
Dim intI As Integer
Dim rngR As Range, rngRR As Range
Dim strNotNum As String, strTemp As String

Set rngRR = Selection.SpecialCells(xlCellTypeConstants, _
xlTextValues)

For Each rngR In rngRR
strTemp = ""
For intI = 1 To Len(rngR.Value)
If Mid(rngR.Value, intI, 1) Like "[0-9]" Then
strNotNum = Mid(rngR.Value, intI, 1)
Else: strNotNum = ""
End If
strTemp = strTemp & strNotNum
Next intI
rngR.Value = strTemp
Next rngR

End Sub


Gord Dibben MS Excel MVP

On Tue, 14 Nov 2006 16:30:39 +0200, "ciruliz" wrote:

Can you make VB macro, which splits up string
by Strings.split(input," ") function, array is created in result.
and then go through all elements in a loop and checks if data type is
numeric .

than you can call macro as usual excel function!

A.


"hitesh" wrote in message
...
i want to seprate the number from the sentence.
in A1 i have a sentence . anil somchand uzenwal. vartak nagar 258932.
in a2 i have sentence . sunil 34521 vartak nagar .

i want a result in cell B1 2588932
in cell B2 34521

so pls help me . i have a lot of data . i want to seprate th all number
from
th sentence. the number can be in middle or starting or the end of the
sentence.

so pls help.






 
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
Reusing formula Tony29 Excel Discussion (Misc queries) 7 September 7th 06 03:34 AM
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM


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