Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
So simple. I feel like a total idiot for missing that one.
Thanks --- Message posted from http://www.ExcelForum.com/ |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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/ |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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/ |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Text Split | New Users to Excel | |||
Text Split | Excel Discussion (Misc queries) | |||
Split text without using data-text to columns | Excel Discussion (Misc queries) | |||
Split Text | Excel Discussion (Misc queries) | |||
text cells end page how split to next. Text lost! | Excel Discussion (Misc queries) |