Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default locating numbers in a text string

Sub Tester11()
Do While Not IsEmpty(ActiveCell)
sStr = ActiveCell.Text
x = 0
For i = 1 To Len(sStr)
sChr = Mid(sStr, i, 1)
If Asc(sChr) = 48 And Asc(sChr) <= 57 Then
x = x + 1
ActiveCell.Offset(0, x).Value = i
End If
Next
ActiveCell.Offset(1, 0).Select
Loop

End Sub

should do what you describe.

--
Regards,
Tom Ogilvy





mcdowell wrote in message
...
I am attempting to sepatate a single string of characters which includes
a middle

sector of numbers beginning and ending at different points. The
procedure needs to

analyze the current cell.... consider each character (loop using
LEN(Xcell)) compare

the character to see if it = "O" thru "9" .. then place the numeric
location point of the

character in a cell in the same row using an ActiveCell.Offset(0,x)
reference. If

multiple numeric characters are found in each string then entries need
to be made in

adjoining columns offset from the ActiveCell. The procedure needs then
to drop to the

line below and perform the process again. I have tried every thing I
know to create a

Sub... using nested loop etc... and I'm baffled.... any help out here??



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
HOW DO I EXTRACT NUMBERS FROM TEXT STRING AndyF Excel Discussion (Misc queries) 7 August 14th 08 02:37 PM
Convert numbers to text string GARY Excel Discussion (Misc queries) 3 May 22nd 08 05:05 AM
Formula Text String: Formatting Text and Numbers? dj479794 Excel Discussion (Misc queries) 5 June 30th 07 12:19 AM
combining text and numbers in a string ajd Excel Worksheet Functions 2 November 3rd 06 04:17 PM
EXTRACT NUMBERS FROM TEXT STRING fiber_doc Excel Worksheet Functions 4 November 28th 05 06:40 PM


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