Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default separating text and numbers into different columns

If I have sv14 in a cell, is there a formula I can use to copy the text characters into one column and the number into another? The number of text characters and number of numerical digits could vary. (however it is a limited list of text characters that would proceed the digits. It would always start with one of the following:
b
v
h
s
d
db
e
s
sv
sh
c
cv
ch
f
pb
pk
po
code
(yes "code" is one of the text strings)
Thank you in advance! Paul
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default separating text and numbers into different columns

Hi Paul,

If there is no decimal

Function TXT(cel As Range)
Dim x As String, i As Integer, n
For i = 1 To Len(cel)
x = Asc(StrConv(Mid(cel, i, 1), vbLowerCase))
If x = 97 And x <= 122 Then
t = t & Mid(cel, i, 1)
End If
Next
TXT = t
End Function

Function NUMBER(cel As Range)
Dim x As String, i As Integer, n
For i = 1 To Len(cel)
x = Asc(StrConv(Mid(cel, i, 1), vbLowerCase))
If x = 49 And x <= 57 Then
n = n & Mid(cel, i, 1)
End If
Next
NUMBER = n * 1
End Function

isabelle

Le 2017-02-20 Ã* 18:23, Paul Doucette a écrit :
If I have sv14 in a cell, is there a formula I can use to copy the text
characters into one column and the number into another? The number of text
characters and number of numerical digits could vary. (however it is a
limited list of text characters that would proceed the digits. It would
always start with one of the following: b v h s d db e s sv sh c cv ch f pb
pk po code (yes "code" is one of the text strings) Thank you in advance!
Paul

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
separating numbers from text SIAMAK Excel Worksheet Functions 2 July 19th 08 01:18 PM
Separating numbers and words into separate columns Windy Excel Discussion (Misc queries) 5 January 23rd 08 07:32 PM
Separating Text From Numbers Santi[_2_] Excel Discussion (Misc queries) 2 January 16th 08 03:11 PM
separating +ve and -ve numbers into two columns Prospect Excel Discussion (Misc queries) 3 December 12th 06 01:47 PM
Help - Separating numbers appearing on the right of a text string Faz1 Excel Worksheet Functions 3 December 14th 05 03:38 PM


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