Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to split text?

I have an excel spreadsheet created from an external database program.
Unfortunatly it didn't format the cells or split the text into
different columns.

An example of which is :

000105 Ritz Camera Center

This is all in one cell.

What i'm trying to do is split the cell in 2, having the Vendor Code in
one cell (000105) and the vendor name in the other.

Ideally i'd like to have a macro split the cell at the first blank
space, but i'm at a loss on how to do that. If anyone has an idea of
how i can do this i'd really appreciate the help. Been hitting my head
against a wall on this one.

James


---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default How to split text?

Jmbostock,

Have you considered to use : Data / Text to Columns...

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *

"Jmbostock" wrote in message
...
I have an excel spreadsheet created from an external database program.
Unfortunatly it didn't format the cells or split the text into
different columns.

An example of which is :

000105 Ritz Camera Center

This is all in one cell.

What i'm trying to do is split the cell in 2, having the Vendor Code in
one cell (000105) and the vendor name in the other.

Ideally i'd like to have a macro split the cell at the first blank
space, but i'm at a loss on how to do that. If anyone has an idea of
how i can do this i'd really appreciate the help. Been hitting my head
against a wall on this one.

James


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to split text?

Suggest using Left and Right Formulas

Martin
-----Original Message-----
Jmbostock,

Have you considered to use : Data / Text to Columns...

--
Regards,
Auk Ales

* Please reply to this newsgroup only *
* I will not react on unsolicited e-mails *

"Jmbostock" wrote

in message
...
I have an excel spreadsheet created from an external

database program.
Unfortunatly it didn't format the cells or split the

text into
different columns.

An example of which is :

000105 Ritz Camera Center

This is all in one cell.

What i'm trying to do is split the cell in 2, having

the Vendor Code in
one cell (000105) and the vendor name in the other.

Ideally i'd like to have a macro split the cell at the

first blank
space, but i'm at a loss on how to do that. If anyone

has an idea of
how i can do this i'd really appreciate the help. Been

hitting my head
against a wall on this one.

James


---
Message posted from http://www.ExcelForum.com/



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to split text?

So simple. I feel like a total idiot for missing that one.

Thanks


---
Message posted from http://www.ExcelForum.com/



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default How to split text?

Because you want to split it in two, you may want to consider a Macro.

Sub Demo()
Dim s As String
s = "000105 Ritz Camera Center"
[B1:C1] = Split(s, Space(1), 2)
End Sub

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"Jmbostock" wrote in message
...
I have an excel spreadsheet created from an external database program.
Unfortunatly it didn't format the cells or split the text into
different columns.

An example of which is :

000105 Ritz Camera Center

This is all in one cell.

What i'm trying to do is split the cell in 2, having the Vendor Code in
one cell (000105) and the vendor name in the other.

Ideally i'd like to have a macro split the cell at the first blank
space, but i'm at a loss on how to do that. If anyone has an idea of
how i can do this i'd really appreciate the help. Been hitting my head
against a wall on this one.

James


---
Message posted from http://www.ExcelForum.com/



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to split text?

as written, you put the results of processing the first cell in the
selection in row 1 (which would be bad if row 1 is not the location of the
first cell in the selection), so you could both reduce the amount of code
and be more consistent with

Sub Splitcells()
For Each s In selection \
Range(Cells(s.row, 2), Cells(s.row, 3)) = _
Split(s, Space(1), 2)
Next
End Sub

--
Regards,
Tom Ogilvy


"Don Guillett" wrote in message
...
Using that method, a multiple condition could be
Sub Splitcells()
x = 1
For Each s In selection 'Range("a2:a22")
Range(Cells(x, 2), Cells(x, 3)) = _
Split(s, Space(1), 2)
x = x + 1
Next
End Sub

--
Don Guillett
SalesAid Software

"Dana DeLouis" wrote in message
...
Because you want to split it in two, you may want to consider a Macro.

Sub Demo()
Dim s As String
s = "000105 Ritz Camera Center"
[B1:C1] = Split(s, Space(1), 2)
End Sub

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"Jmbostock" wrote in message
...
I have an excel spreadsheet created from an external database program.
Unfortunatly it didn't format the cells or split the text into
different columns.

An example of which is :

000105 Ritz Camera Center

This is all in one cell.

What i'm trying to do is split the cell in 2, having the Vendor Code

in
one cell (000105) and the vendor name in the other.

Ideally i'd like to have a macro split the cell at the first blank
space, but i'm at a loss on how to do that. If anyone has an idea of
how i can do this i'd really appreciate the help. Been hitting my head
against a wall on this one.

James


---
Message posted from
http://www.ExcelForum.com/







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
Text Split DDay New Users to Excel 4 May 14th 09 02:39 PM
Text Split DDay Excel Discussion (Misc queries) 5 May 14th 09 12:39 PM
Split text without using data-text to columns Jambruins Excel Discussion (Misc queries) 7 January 21st 06 02:16 PM
Split Text Gabe Excel Discussion (Misc queries) 6 January 4th 06 09:52 PM
text cells end page how split to next. Text lost! Elaine Excel Discussion (Misc queries) 1 August 28th 05 05:48 PM


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