Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default separate "A1200:AB13000" into A, 1200, AB, 1300

Hi,
I have to separate a range into alphabetical and numerical part before
and after ":". The problem is i can not use left("text",2) as the
length of string (range) varies....

Eg.

string "A1200:AB13000" --like to get--

lefttext = A, leftnumber = 1200, righttext=AB, rightnumber=13000


the length of string is not fix ....and this is a big problem for
me....might not for you :)

Please help me...or let me know where can i find the info....

Thanks a lot....

musa.biralo

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default separate "A1200:AB13000" into A, 1200, AB, 1300

Hi

Data Text To Columns with semicolon as separator (and be sure there is a
free column as next to one with original data).

Arvi Laanemets


"musa.biralo" wrote in message
ups.com...
Hi,
I have to separate a range into alphabetical and numerical part before
and after ":". The problem is i can not use left("text",2) as the
length of string (range) varies....

Eg.

string "A1200:AB13000" --like to get--

lefttext = A, leftnumber = 1200, righttext=AB, rightnumber=13000


the length of string is not fix ....and this is a big problem for
me....might not for you :)

Please help me...or let me know where can i find the info....

Thanks a lot....

musa.biralo



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default separate "A1200:AB13000" into A, 1200, AB, 1300

Hi Arvi
Thanks a lot for the idea.

I am trying to this from Macro so....( i did by recording macro) but
thing is it can not separate you text part and numeric part...

Please let me know if you know other way...
Thanks again.

musa.biralo


Arvi Laanemets wrote:
Hi

Data Text To Columns with semicolon as separator (and be sure there is a
free column as next to one with original data).

Arvi Laanemets


"musa.biralo" wrote in message
ups.com...
Hi,
I have to separate a range into alphabetical and numerical part before
and after ":". The problem is i can not use left("text",2) as the
length of string (range) varies....

Eg.

string "A1200:AB13000" --like to get--

lefttext = A, leftnumber = 1200, righttext=AB, rightnumber=13000


the length of string is not fix ....and this is a big problem for
me....might not for you :)

Please help me...or let me know where can i find the info....

Thanks a lot....

musa.biralo


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 380
Default separate "A1200:AB13000" into A, 1200, AB, 1300

Dim sTest As String
Dim iFirstRow As Long
Dim iLastRow As Long
Dim sFirstCol As String
Dim sLastCol As String
Dim rng As Range

sTest = "A1200:AB13000"
Set rng = Range(sTest)
iFirstRow = rng.Row
iLastRow = rng.Rows.Count + iFirstRow - 1
sFirstCol = Replace(Left(sTest, InStr(sTest, ":") - 1), iFirstRow, "")
sLastCol = Replace(Replace(sTest, sFirstCol & iFirstRow & ":", ""),
iLastRow, "")


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"musa.biralo" wrote in message
ups.com...
Hi,
I have to separate a range into alphabetical and numerical part before
and after ":". The problem is i can not use left("text",2) as the
length of string (range) varies....

Eg.

string "A1200:AB13000" --like to get--

lefttext = A, leftnumber = 1200, righttext=AB, rightnumber=13000


the length of string is not fix ....and this is a big problem for
me....might not for you :)

Please help me...or let me know where can i find the info....

Thanks a lot....

musa.biralo



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default separate "A1200:AB13000" into A, 1200, AB, 1300

Thanks a lot Bob....

Sorry for late response...but it worked like a charm.....

Huge thanks...

musa.biralo

Bob Phillips wrote:
Dim sTest As String
Dim iFirstRow As Long
Dim iLastRow As Long
Dim sFirstCol As String
Dim sLastCol As String
Dim rng As Range

sTest = "A1200:AB13000"
Set rng = Range(sTest)
iFirstRow = rng.Row
iLastRow = rng.Rows.Count + iFirstRow - 1
sFirstCol = Replace(Left(sTest, InStr(sTest, ":") - 1), iFirstRow, "")
sLastCol = Replace(Replace(sTest, sFirstCol & iFirstRow & ":", ""),
iLastRow, "")


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"musa.biralo" wrote in message
ups.com...
Hi,
I have to separate a range into alphabetical and numerical part before
and after ":". The problem is i can not use left("text",2) as the
length of string (range) varies....

Eg.

string "A1200:AB13000" --like to get--

lefttext = A, leftnumber = 1200, righttext=AB, rightnumber=13000


the length of string is not fix ....and this is a big problem for
me....might not for you :)

Please help me...or let me know where can i find the info....

Thanks a lot....

musa.biralo




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default separate "A1200:AB13000" into A, 1200, AB, 1300

On 8 Nov 2006 10:57:20 -0800, "musa.biralo" wrote:

Hi,
I have to separate a range into alphabetical and numerical part before
and after ":". The problem is i can not use left("text",2) as the
length of string (range) varies....

Eg.

string "A1200:AB13000" --like to get--

lefttext = A, leftnumber = 1200, righttext=AB, rightnumber=13000


the length of string is not fix ....and this is a big problem for
me....might not for you :)

Please help me...or let me know where can i find the info....

Thanks a lot....

musa.biralo


For a formula solution, you could download and install Longre's free
morefunc.xll add-in from http://xcell05.free.fr/

Then, with your data in A1,

B1: =REGEX.MID($A1,"[A-Z]+|\d+",COLUMNS($A:A))

Copy/drag across as far as required.


--ron
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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ... Maria J-son[_2_] Excel Programming 2 March 5th 06 12:20 PM


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