Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
instauratio
 
Posts: n/a
Default creating a list from a column of semicolon

I have one column that contains 1000 values. The problem is they do not
occupy one value per one cell with 1000 rows.

Some rows/cells have 10 to 15 values, each separated by a semi colon.

How can I sort or filter the entire column and separate each value into it's
own unique cell in one column?
  #2   Report Post  
bj
 
Posts: n/a
Default

I would suggest using <data<Text to columns <delimited with ;
after doing this I would use <edit<goto<special<last cell to identify
the highest column with data.
Sequencially Back to column B, I would sort these columns Cut and paste the
results to the bottom of column A.

"instauratio" wrote:

I have one column that contains 1000 values. The problem is they do not
occupy one value per one cell with 1000 rows.

Some rows/cells have 10 to 15 values, each separated by a semi colon.

How can I sort or filter the entire column and separate each value into it's
own unique cell in one column?

  #3   Report Post  
Martin P
 
Posts: n/a
Default

Copy to Word. Convert Table to Text (separate text with paragraph marks). Use
Edit, Replace to replace semi-colons with paragraph marks and then double
paragraph marks with single paragraph marks. Copy back to Excel.

"instauratio" wrote:

I have one column that contains 1000 values. The problem is they do not
occupy one value per one cell with 1000 rows.

Some rows/cells have 10 to 15 values, each separated by a semi colon.

How can I sort or filter the entire column and separate each value into it's
own unique cell in one column?

  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

This worked ok for me:

Option Explicit
Sub testme()

Dim curWks As Worksheet
Dim newWks As Worksheet
Dim destCell As Range
Dim NumberOfRows As Long

Dim myRng As Range
Dim myCell As Range
Dim mySplit As Variant

Set curWks = Worksheets("sheet1")
Set newWks = Worksheets.Add

With curWks
Set myRng = .Range("a1", .Cells(.Rows.Count, "A").End(xlUp))
End With

Set destCell = newWks.Range("a1")

For Each myCell In myRng.Cells
mySplit = Split97(myCell.Value, ";")
'or if xl2k and higher
'mySplit = Split(myCell.Value, ";")
NumberOfRows = UBound(mySplit) - LBound(mySplit) + 1
destCell.Resize(NumberOfRows, 1).Value _
= Application.Transpose(mySplit)

Set destCell = destCell.Offset(NumberOfRows, 0)
Next myCell

End Sub
Function Split97(sStr As String, sdelim As String) As Variant
'from Tom Ogilvy
Split97 = Evaluate("{""" & _
Application.Substitute(sStr, sdelim, """,""") & """}")
End Function

Split was added in xl2k. If you're using xl97, use Tom's split97. If you and
your users are all at xl2k or higher, you can delete that function completely.


If you're new to macros, you may want to read David's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm


instauratio wrote:

I have one column that contains 1000 values. The problem is they do not
occupy one value per one cell with 1000 rows.

Some rows/cells have 10 to 15 values, each separated by a semi colon.

How can I sort or filter the entire column and separate each value into it's
own unique cell in one column?


--

Dave Peterson
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
Creating a dynamic list Jarrod A Excel Worksheet Functions 1 November 18th 05 11:29 PM
Lookup Table Dilemma Karen Excel Worksheet Functions 2 June 10th 05 08:22 PM
how do i find out what is uncommon in column list A1: A10 and B1:. vikasarora07 Excel Discussion (Misc queries) 1 April 12th 05 03:47 PM
Creating a dynamic list JarrodA Excel Worksheet Functions 3 October 30th 04 04:01 AM
Creating a list from an existing list. Jad Excel Worksheet Functions 1 October 29th 04 06:00 AM


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