Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Splitting text in a cell

I currently have cells populated with text and am wanting to split the text
from within the cell into two.

Example:

a1: contains 'SHEFFIELD UNITED:BLADES'
a2: contains 'SHEFFIELD WEDNESDAY:OWLS'
I am wanting to split the text for that every thing to the left of ':' is in
on cell and every thing that is to the right of ':' to be in another cell.

Can this be done?

Cheers
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Splitting text in a cell

Use Text to Columns:

1. select the column
2. pull-down Data Text to Columns then select delimited then select the
colon
--
Gary's Student


"TheRook" wrote:

I currently have cells populated with text and am wanting to split the text
from within the cell into two.

Example:

a1: contains 'SHEFFIELD UNITED:BLADES'
a2: contains 'SHEFFIELD WEDNESDAY:OWLS'
I am wanting to split the text for that every thing to the left of ':' is in
on cell and every thing that is to the right of ':' to be in another cell.

Can this be done?

Cheers

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Splitting text in a cell

Hi TheRook,

If you require a VBA solution, try something like:

'=============
Public Sub Tester()
Dim SH As Worksheet
Dim rng As Range
Dim rCell As Range
Dim arr As Variant

Set SH = ActiveSheet

With SH
Set rng = .Range("A1", .Cells(Rows.Count, "A").End(xlUp))
End With

For Each rCell In rng.Cells
With rCell
arr = Split(.Value, ":")
.Value = arr(0)
.Offset(0, 1) = arr(1)
End With
Next rCell
End Sub
'<<=============


---
Regards,
Norman



"TheRook" wrote in message
...
I currently have cells populated with text and am wanting to split the text
from within the cell into two.

Example:

a1: contains 'SHEFFIELD UNITED:BLADES'
a2: contains 'SHEFFIELD WEDNESDAY:OWLS'
I am wanting to split the text for that every thing to the left of ':' is
in
on cell and every thing that is to the right of ':' to be in another cell.

Can this be done?

Cheers



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Splitting text in a cell

See if this can help.
Assume your A1 cell contains: SHEFFIELD UNITED:BLADES

use formula in B1
=LEFT(A1,FIND(":",A1)-1)

use this formula in C1
=RIGHT(A1,LEN(A1) - FIND(":",A1))









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
Splitting text in a cell Richard_123 Excel Worksheet Functions 4 July 27th 07 08:24 PM
Splitting text in a cell Richard_123 Excel Discussion (Misc queries) 4 July 26th 07 09:47 PM
splitting text from one cell rogera Excel Discussion (Misc queries) 1 January 10th 06 01:43 PM
splitting text in a cell.. via135 Excel Discussion (Misc queries) 5 December 23rd 05 01:04 AM
Splitting Up Text in One Cell To Many Bert_Lady Excel Worksheet Functions 3 December 9th 05 01:55 AM


All times are GMT +1. The time now is 04:49 AM.

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"