Split String At First Delimiter Only
Nov 11, 2008
I have a column with cells that look like: XYZ - JobABC - Area 1-A. I'd like to split the column into to and have it look like: XYZ <next column> Job ABC - Area 1-A
Normally I'd use the text to columns function and "-" as delimiter, however, there are other instances of "-" which I do not want separated. Note that the XYZ can vary in length and therefore fixed width will not work either. I have attached a small sample with the different variations that I could encounter.
View 7 Replies
ADVERTISEMENT
Sep 3, 2008
I'm prepping this file to be pushed through mail merge. The sheet has 25,213 rows.
Column I contains a long string of character (for the purposes of my project the field is called Subjects) and $ used as delimiters (approx 70 or as few as 1). This column needs to be split apart by $ and the separate Subjects that result from splitting apart by $ needs to be placed on a separate line. Once each Subject is on a separate line, all of the Subjects need to be lined up in Column I, one under another (the obvious result at this point is GREATLY increasing the number of rows in the sheet). Next, all of the data that is contained in each Subject's originating row will be copied to each of newly created rows (without copying over the Subject contained in column I).
After writing this all out, I realize (once again).
View 14 Replies
View Related
Apr 24, 2012
How do i split some text in range if it does not have a delimiter? I would like to have a comma after each letter/number or have the option to split to individual cells
I know how to use the vba split function with a delimiter but cant figure this out.
I.e susanna
S,u,s,a,n,n,a.
View 4 Replies
View Related
Oct 18, 2006
I recently got this task by my work employer to transfer information from several non-organized Excel-documents into one, complete and organized one.
The thing I have to organize right now is a column with thousands of zipcodes and zones in one single cell, only separated by spaces, like this:
Zipcode Zone
115 54 Gothenburg
443 67 Skane
What I want to do is instead of having to go through 24h of braindead control/paste is to use some easy and fast function or script that could pull out the last piece of string of information in every cell in that column into its own separate cell.
Although I am using Open Office Calc/Gnumeric on Ubuntu Dapper, if a script is necessary and only work with Excel on Windows/Mac, that is no big problem for me to solve. So please, any suggestion is welcome.
I will attatch two examples for you to look at, to get the whole picture.
View 8 Replies
View Related
Feb 28, 2007
I have one column in a worksheet that I want to split into 2 columns. If there is one "(" in the cell, I want to split at that point, but if there are two "(" 's, I want to split at the second occurrence. I can use the Like operator to identify the cells, but is there a way to specify which delimiter in a sequence of identical delimiters to split at? Here are templates (not actual data) of the two type of cells:
Name1 (ABC) (Name2, Name3)
Name4 (Name5, Name6)
For the first, I want to split on the second "(", before Name2, and for the second, I want to split on the first "(", before Name5.
View 4 Replies
View Related
Jul 1, 2008
I've got a column of data containing addresses. What I want to do is split the column after certain keywords such as "street", "road", "close" etc and move any words that come after these in the cell into the next cell to the right.
For example, in one cell I might have "54 Burberry Road Finsbury London"... what I want to do is have part of the text remain in the original cell i.e. "54 Burberry Road" and the rest, "Finsbury London", moved to the cell on the right.
Not all cells in the column will match this format so if it doesn't find a keyword, nothing will occur and it will move to the next cell down etc. until it reaches the end of the column.
There are no delimiters (apart from the spaces) between the words.
I haven't figured out all of the keywords that I will need to search for yet but I should be able to extrapolate from something fairly generic.
View 5 Replies
View Related
Feb 14, 2014
I am looking for a solution to split text from numbers.I have found a couple examples on the web but I cannot get the examples to work with the correct syntax to function.
Sample cells. The string could be any integer or floating point number with text. (The text is always after the number.)
1234txt
12.222txv
102.1hknn
Result needed
col1
1234
12.222
102.1
col2
txt
tvx
hknn
View 4 Replies
View Related
Aug 24, 2012
My excel database sheet contains inventory of products and quantities, each is defined in the form of combined number followed by text without a delimiter. For example 2AWS means Two (2) of AWS.
Each cell of the inventory field may contain up to two products, each product is identified in the above format; but the pair of products are separated with a comma.
The inventory field is occupying from cell $A$2:$A$5000; and is defined as a named range "INV_QTY" with scope within the entire workbook. I need to calculate the total inventory for each product.
Here's an example:
Cell A2: 3GFG, 1AWS
Cell A3: 2NG, 2AWS
Cell A4: 3AWS
Cell A5: 4QLK, 4GFG
etc.
The desired output should be calculated as follows (assume Input will be on Column C & D)
Product - QTY
GFG - 7 (i.e. Cell C2: GFG , Cell D2:7 etc.)
AWS - 6
NG - 2
QLK - 4
View 7 Replies
View Related
Jul 3, 2014
I want to split the contents of a single cell(ALT Enter as delimiter) into multiple cells and retain the values in column B.
Ex:
A1: apple
banana
car
house
A2: yellow
B2: building
x
y
B3: O
Output:
sheet 2:
A1: apple B1: yellow
A2: banana B2: yellow
A3: car B3: yellow
A4: house B4: yellow
A5: building B5: O
A6: x B6: O
A7 B7: O
View 9 Replies
View Related
Dec 1, 2008
I have a string of text in one cell on Sheet 1 (ie., A1, Sheet 1), here is a excerpt:
A-dec International Inc., A. Bellotti, A. DEPPELER S.A., etc ...
What I need to do is split the cell into separate rows, using the comma as a delimiter. I will be reading the cell from another sheet and need a formula that will provide me with
A1: A-dec International Inc.
A2: A. Bellotti
A3: A. DEPPELER S.A.
View 9 Replies
View Related
Mar 14, 2009
I have tried experimenting with LEFT, RIGHT functions. I want to edit a text string using a delimiter. For example: "NOS|NOS". I have a column of 256 rows of such entries, a name; the pipe; a name. I need to be able to strip out one side or the other using that pipe as the delimiter, leaving only "NOS". With 256 rows of items with this format - the length of the text string will vary.
View 3 Replies
View Related
Jun 20, 2008
I have a script to import all the data in a text file into an excel sheet. However, the data that is imported are in the first column of every row.
for e.g.
123454566788329929201012827192019128278111111111abc213123123123123
there is no comma nor / to separate the string of alphanumerics is there any vba script that i can incorporate to separate the first 3 digit in the first column then 5 digit in the second column then 7 digit in the 3rd columns and etc.
View 8 Replies
View Related
Aug 14, 2014
I'm trying to extract all the numbers from the left of the delimiter ":" . They can occur once or more.
E.g. cell F2 contains BP2.2.1:40 BP2.2.1:50 BP2.2.1:60 BP2.2.1:70 BP2.4.1:80
and what i want as a result is : BP2.2.1 BP2.2.1 BP2.2.1 BP2.2.1 BP2.4.1.
I've tried =IFERROR(LEFT(F2,FIND(":",F2)-2), " ") but only displays 1 out of a possible 4 in the cell.
View 12 Replies
View Related
Nov 17, 2009
So I have strings like the one below. What I'm looking for the text behind the ":" being, 17-SEP-2009, 000737-EWO, SRS and finally 002-YAO
Example string:
date: 17-SEP-2009, number:000737-EWO, detail: SRS, DD:002-YAO
My ...
View 8 Replies
View Related
Feb 25, 2014
Is there any way to split this string so I get Letter number number number in seperate cells?
|A533|B15A|C025|D205|E240|F036|G450|H166|P210|V123|W60C|X257|X264|Y108|Y233|Y288|Y426|Y428|Y432|
View 2 Replies
View Related
Dec 19, 2008
I'm trying to split the string in textbox 1 so i get the first name and the last name but this doesn't seem to work?
View 3 Replies
View Related
Nov 13, 2009
I need to split a string in all cells in one column (delimiter = ""). What I basically want is to get just the first word in the cell.
View 4 Replies
View Related
Sep 20, 2008
Say I have a string, "a test array." I want to split this into an array where each character is an element. I was thinking something like
Dim MyArray As Variant
Dim MyString As String
MyString = "a test array"
MyArray = Split(MyString, "", Len(MyString), vbTextCompare)
But this doesn't work because Split() returns the entire string when the delimiter is a zero-length string.
View 9 Replies
View Related
Apr 3, 2009
I'm stumbling upon something I just can't figure out. I thought I was being very clever using the Split() function, and it did all work beautifully for a while.
I've got a list sort of like this:
Helloworld
Hello of World
Hello1 of Planet
And I want to be able to run the following code.
For Each u In units
d_type_a = Split(u.Value, " of")
Debug.Print (d_type_a(0))
Select Case u.Value
Case "Hello"
stuff...
Case "Helloworld"
stuff...
Case "Hello1"
stuff...
End select
next
But it fails on the Debug.print with a "Subscript out of range, nr 9" error. The debug is just there because it doesn't want to work. The debug.print DOES out put "Helloworld" into the Immediate window but then still fails which sorta confuses me.
The best I can figure out is that it just doesn't quite like the string without an " of" in it.
View 9 Replies
View Related
Oct 25, 2012
I would like a vba script to split a string of cells that are in the ACTIVECOLUMN.
It would split at each to the next column across.
i.e. split
C:Program Files est est1 est2 est3
to
A1
B1
C1
D1
E1
C:Program Files
test
test1
test2
test3
This is not for column A though it would be for the ACTIVECOLUMN range.
There could be up to 13 sub folders ()
View 7 Replies
View Related
Jul 30, 2013
I set out this morning to count duplicates in an array and report a succinct list.... so I went down the route of using a collection with keys to do this.
1. Is there a better way? Else
2. split my collection values? I'm a bit stuck.
I have a series of values in a collection like this
: Item 2 : "Spam|01/07/2013|1" : Variant/String
: Item 4 : "Chips|01/07/2013|2" : Variant/String
So I have 3 key pieces of data delimited by a pipe sign -
Product | Date | Number of Occurrences
Item 4 is of interest to me because it occurs twice.
How I can turn those collection values into something I can work with, else another approach to sum rows in an array which are duplicates (if you only look at 2 columns).
View 6 Replies
View Related
Oct 9, 2013
In filed I have couple of value separated by comma like below:
A1 header1
B1 header2
C1 header3
Audi
592035, 579733, 653749, 579735
20 000
If my macro found that string (always will be separate by ",") should split the string and add rows (= to number of string). The output should be as below:
A1 header1
B1 header2
C1 header3
Audi
592035
20 000
[Code] .....
I have:
Code:
Set sourceWb = ActiveWorkbook
Set ws = sourceWb.Worksheets(1)
Dim LastRow As Long
Dim MY_Split As Variant
LastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row
[Code] ...........
View 1 Replies
View Related
Apr 30, 2014
I can not get this to work:
Code:
Sub SplitApart()
Dim data As String
data = Sheets(1).Cells(20, 1).Text
For Each EachSplit in Split(data)
n = n + 1
Sheets(1).Cells(20, n + 1) = EachSplit
Next
End Sub
Error code when Debugging on "Split":
"Wrong Number of arguments or invalid property assignment"
View 4 Replies
View Related
Mar 16, 2009
I have a filname called ex: "Statusreport xxyyzz.xls"
I'm only interested to put xxyyzz in a variable and reuse it for saving another workbook.
How can I use the different string functions for this. The word "Statusreport" is used for apporx 20 different workbooks.
View 9 Replies
View Related
Nov 12, 2009
I need to open a text based file (not a txt file), read the data in as a String. Split the string and paste into a worksheet. The string really has 2 delimitors a & and a =.
Ideally, I would like to keep only what was between the = and the &. But would settle for splitting the string by &, then putting token to left of = in one column and token to right of = in the next column. The first sounded cleaner, but I'm getting desparate.
This didn't sound hard when I started, but I've never really done VBA before and it has been posing a much greater problem than I thought. I've tried several things, but this is the latest rendition. Am I thinking too much in terms of C++ and Java? ...
View 9 Replies
View Related
Jun 8, 2007
I have a string which follows this format: "App Alg FMA", "App Pgm FMA", "App Slf FMA" This string can shrink or grow dynamically depending on the number of App*'s selected. How can I split this string and load the App*'s into an Array so the array would contain the following
Array(0) = "App Alg FMA",
Array(1) = "App Pgm FMA",
Array(2) = "App Slf FMA",
View 2 Replies
View Related
Jul 1, 2013
I have a string like this:
VB:
test = "banana|apple|limon"
I did this:
VB:
test_2 = split(test,"|")
The code returned the test_2 var like a matrix with 3 data inside.
But when I try to copy the data inside with:
VB:
For i = 0 To UBound(teste_2)
test_3 = teste_2(i)
Next i
The code editor returns a ByRef error.
How to solve?
View 5 Replies
View Related
Feb 22, 2010
I am looking for a way to split a large string (400 numeric value's, split by comma's) into a 20x20 field.
If possible, the field should be 600x400 pixels (30x20 squares), but this is just extra
Is there a way to do this in Excel (or any other program)?
View 9 Replies
View Related
Jun 8, 2006
I am having trouble figuring out how to split the data in a column.
For Example on the attached .xls - the first few records under the SIC column are:
73790200
59470104
70110100
581223
& how i want them to look in seperate columns:
73 790200
59 470104
70 110100
58 1223
I need the first two digits in their own column and the rest of the number in it's own column. I have over 6,000 records, so doing it manually is not a place I want to go!
View 3 Replies
View Related
Oct 9, 2006
I have a spreadsheet with Approx 900 rows of information that has been entered incorrectly.
Spreadsheet has 6 columns.
Contact Name
Contact Number
Company Name
Company Account Number
Order Date
Order Numbers
Every Order should have its own line - However I have approx 900 rows where the order numbers have multiple entries instead of single entries.
All the order numbers end "LO" and there all 8 digits long.
I wanted to know if its possible to use excel to look for all instances of "LO" in the column Order Numbers and delete the original Row and replace it with 3 rows with the same information.
Example:
Attached to this post!
I have 15 historic files each approx 35000 rows and I suspect there are more errors
View 9 Replies
View Related