Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Creating a separate cell entry for every individual line in a cell

Hi

I have a lot of cells of data with free text in them.

In order to use this data I need to create a separate cell for every line of
text within a cell.

The lines have been defined in the original cells using the Alt-Enter
function.

Does anyone have an idea of how to tackle this?

Any help much appreciated
David
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Creating a separate cell entry for every individual line in a cell

It is pretty simple in a macro to find and extract the cells that hae the
carrriagge return. The problem is where do you put the new lines into the
worksheet. You could add it to the row bleow, but that cell may contain data
you don't want over-written. Inserting new cells may not be good either.
The new cells would add new rows and making some of the data in rows below
not being on the same row.

You need to give more definition of your worksheet layout before a macro can
be writen.

"DaveyC4S" wrote:

Hi

I have a lot of cells of data with free text in them.

In order to use this data I need to create a separate cell for every line of
text within a cell.

The lines have been defined in the original cells using the Alt-Enter
function.

Does anyone have an idea of how to tackle this?

Any help much appreciated
David

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Creating a separate cell entry for every individual line in a

Joel

The format is simply a column (column B) of around 650 cells each with a
unique identifier in a separate column (column A)

It would be my intent to put the generated "expanded" cells in a separate
worksheet retaining their original but now multiple identifiers.

Is this clearer?

David

"Joel" wrote:

It is pretty simple in a macro to find and extract the cells that hae the
carrriagge return. The problem is where do you put the new lines into the
worksheet. You could add it to the row bleow, but that cell may contain data
you don't want over-written. Inserting new cells may not be good either.
The new cells would add new rows and making some of the data in rows below
not being on the same row.

You need to give more definition of your worksheet layout before a macro can
be writen.

"DaveyC4S" wrote:

Hi

I have a lot of cells of data with free text in them.

In order to use this data I need to create a separate cell for every line of
text within a cell.

The lines have been defined in the original cells using the Alt-Enter
function.

Does anyone have an idea of how to tackle this?

Any help much appreciated
David

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Creating a separate cell entry for every individual line in a

Try this code. to use macro
1) right click on tab on bottom of worksheet which normally says sheet1 or
you sheetname
2) Select Code
3) On VBA menu Insert - Module
4) Paste code below into module. remove if the website adds
5) go to spreadsheet and run macro from Tools Menu - Macro - Macros -
Splittextt


Sub Splittext()

LF = Chr(10)

Lastrow = Range(Cells(1, 1), Cells(Rows.Count, 1)).End(xlDown).Row

LoopCount = 1
RowCount = 1
Do While LoopCount <= Lastrow

CellText = Cells(RowCount, 2)

If InStr(CellText, LF) 0 Then

Do While InStr(CellText, LF)

LFPosition = InStr(CellText, LF)
FirstLine = Left(CellText, LFPosition - 1)
CellText = Mid(CellText, LFPosition + 1)

Cells(RowCount, 2) = FirstLine

Range(Cells(RowCount + 1, 1), Cells(RowCount + 1, 2)). _
Insert Shift:=xlDown
Cells(RowCount, 2) = FirstLine
RowCount = RowCount + 1

Loop

If (Len(CellText)) 0 Then

Cells(RowCount, 2) = CellText
RowCount = RowCount + 1

End If

End If

LoopCount = LoopCount + 1
Loop

End Sub

"DaveyC4S" wrote:

Joel

The format is simply a column (column B) of around 650 cells each with a
unique identifier in a separate column (column A)

It would be my intent to put the generated "expanded" cells in a separate
worksheet retaining their original but now multiple identifiers.

Is this clearer?

David

"Joel" wrote:

It is pretty simple in a macro to find and extract the cells that hae the
carrriagge return. The problem is where do you put the new lines into the
worksheet. You could add it to the row bleow, but that cell may contain data
you don't want over-written. Inserting new cells may not be good either.
The new cells would add new rows and making some of the data in rows below
not being on the same row.

You need to give more definition of your worksheet layout before a macro can
be writen.

"DaveyC4S" wrote:

Hi

I have a lot of cells of data with free text in them.

In order to use this data I need to create a separate cell for every line of
text within a cell.

The lines have been defined in the original cells using the Alt-Enter
function.

Does anyone have an idea of how to tackle this?

Any help much appreciated
David

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Creating a separate cell entry for every individual line in a cell

You can break these into separate cells across a row using DataText to
ColumnsDe-limited byOtherAlt + 0010(on the numpad)


Gord Dibben MS Excel MVP

On Thu, 15 Mar 2007 05:31:13 -0700, DaveyC4S
wrote:

Hi

I have a lot of cells of data with free text in them.

In order to use this data I need to create a separate cell for every line of
text within a cell.

The lines have been defined in the original cells using the Alt-Enter
function.

Does anyone have an idea of how to tackle this?

Any help much appreciated
David


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
Cell Entry That Locks Selected Cells From Any Data Entry. ron Excel Worksheet Functions 5 February 16th 07 09:52 PM
Can you enter a new line in an individual cell within Excel Landolas Excel Discussion (Misc queries) 1 June 30th 06 11:04 AM
Separate first and second name in one cell into separate cells. Dwight in Georgia Excel Discussion (Misc queries) 3 January 25th 06 09:09 PM
How do I separate worksheets in a workbook into individual files? jmd Excel Worksheet Functions 3 December 13th 05 09:18 PM
Separate first and second name in one cell into separate cells. Gary's Student Excel Discussion (Misc queries) 0 April 27th 05 11:11 PM


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