Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am hoping that someone can offer help with this matter.
I have the following text that I need to break into separate columns to get the sentences separated: "1.2.3 This is an example. That I need to break down" What I get when I do a texttocolumn using the "." as the separator: "1" "2" "3" "This is an example" "That I need to break down" What I am trying to get is: "1.2.3" "This is an example" "That I need to break down" Is there someway of breaking the "1.2.3" out first? Thanks for any help. Troy Vincent |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim s As String
Dim FirstPart As String Dim OtherParts() As String s = "1.2.3 This is an example. That I need to break down" FirstPart = Split(s, " ", 2)(0) OtherParts = Split(Split(s, " ", 2)(1), ".") FirstPart returns a single string OtherParts returns a (zero-based) array "Viking" wrote: I am hoping that someone can offer help with this matter. I have the following text that I need to break into separate columns to get the sentences separated: "1.2.3 This is an example. That I need to break down" What I get when I do a texttocolumn using the "." as the separator: "1" "2" "3" "This is an example" "That I need to break down" What I am trying to get is: "1.2.3" "This is an example" "That I need to break down" Is there someway of breaking the "1.2.3" out first? Thanks for any help. Troy Vincent |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Charlie
That worked great for the most part. When I ran a test to the text that I am working with I found that the following happened. when the numbers changed to something like "1.4.0 This is an example. That I need to break down" I get "1.4" "This is an example" "That I need to break down" It is droping the .0 Any Ideas on how I would be able to keep it. Thanks in advance Troy Vincent Charlie wrote: Dim s As String Dim FirstPart As String Dim OtherParts() As String s = "1.2.3 This is an example. That I need to break down" FirstPart = Split(s, " ", 2)(0) OtherParts = Split(Split(s, " ", 2)(1), ".") FirstPart returns a single string OtherParts returns a (zero-based) array "Viking" wrote: I am hoping that someone can offer help with this matter. I have the following text that I need to break into separate columns to get the sentences separated: "1.2.3 This is an example. That I need to break down" What I get when I do a texttocolumn using the "." as the separator: "1" "2" "3" "This is an example" "That I need to break down" What I am trying to get is: "1.2.3" "This is an example" "That I need to break down" Is there someway of breaking the "1.2.3" out first? Thanks for any help. Troy Vincent |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That's unusual. Could you post the exact code and data you are using? I
will be hitting the road shortly but someone else may be able to figure it out. "Viking" wrote: Charlie That worked great for the most part. When I ran a test to the text that I am working with I found that the following happened. when the numbers changed to something like "1.4.0 This is an example. That I need to break down" I get "1.4" "This is an example" "That I need to break down" It is droping the .0 Any Ideas on how I would be able to keep it. Thanks in advance Troy Vincent Charlie wrote: Dim s As String Dim FirstPart As String Dim OtherParts() As String s = "1.2.3 This is an example. That I need to break down" FirstPart = Split(s, " ", 2)(0) OtherParts = Split(Split(s, " ", 2)(1), ".") FirstPart returns a single string OtherParts returns a (zero-based) array "Viking" wrote: I am hoping that someone can offer help with this matter. I have the following text that I need to break into separate columns to get the sentences separated: "1.2.3 This is an example. That I need to break down" What I get when I do a texttocolumn using the "." as the separator: "1" "2" "3" "This is an example" "That I need to break down" What I am trying to get is: "1.2.3" "This is an example" "That I need to break down" Is there someway of breaking the "1.2.3" out first? Thanks for any help. Troy Vincent |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
text column - via macro | New Users to Excel | |||
Macro for text to column | Excel Discussion (Misc queries) | |||
Text to column macro | Excel Discussion (Misc queries) | |||
Macro delimiting text if column has value | Excel Programming | |||
text to column macro | Excel Worksheet Functions |