PC Review


Reply
Thread Tools Rate Thread

How do I split content in one cell into seperate cells?

 
 
=?Utf-8?B?QS4gU2luZ2g=?=
Guest
Posts: n/a
 
      2nd Apr 2007
I have an Access 2003 DB where one of the columns contains multiple names
(10-15), seperated by special seperators that look like rectangular boxes.

I want to sperate each name so that each appears in individual row/column
alongside.

Kindly help.

Thanks,

A. Singh


 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      2nd Apr 2007
Write a VBA function that opens 2 records:
- the source table, with the concatenated field;
- the target table that you want to add records to.

Use the Split() function to parse the elements into an array.
Loop through the array elements from LBound to Ubound.
For each one, use AddNew and Update to add the records to the target table.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"A. Singh" <A. (E-Mail Removed)> wrote in message
news:A26DC0A8-B324-4DA8-80E5-(E-Mail Removed)...
>I have an Access 2003 DB where one of the columns contains multiple names
> (10-15), seperated by special seperators that look like rectangular boxes.
>
> I want to sperate each name so that each appears in individual row/column
> alongside.
>
> Kindly help.
>
> Thanks,
>
> A. Singh


 
Reply With Quote
 
=?Utf-8?B?T2ZlciBDb2hlbg==?=
Guest
Posts: n/a
 
      2nd Apr 2007
Create a function in a module, in that example the seperator between the
names will be ~

Function MySplit(MyStr As String, MyLocation As Integer)
On Error goto MySplit_Err
MySplit = Split(MyStr, "~")(MyLocation)

Exit Function
MySplit_Err:
MySplit = ""
End Function

In the Query you can use this spit function to split the field

Select MySplit([FieldName],0) As FirstName, MySplit([FieldName],1) As
SecondName, MySplit([FieldName],2) As ThirdName From TableNAme


--
Good Luck
BS"D


"A. Singh" wrote:

> I have an Access 2003 DB where one of the columns contains multiple names
> (10-15), seperated by special seperators that look like rectangular boxes.
>
> I want to sperate each name so that each appears in individual row/column
> alongside.
>
> Kindly help.
>
> Thanks,
>
> A. Singh
>
>

 
Reply With Quote
 
=?Utf-8?B?QS4gU2luZ2g=?=
Guest
Posts: n/a
 
      2nd Apr 2007
Thanks.

A. Singh

"Allen Browne" wrote:

> Write a VBA function that opens 2 records:
> - the source table, with the concatenated field;
> - the target table that you want to add records to.
>
> Use the Split() function to parse the elements into an array.
> Loop through the array elements from LBound to Ubound.
> For each one, use AddNew and Update to add the records to the target table.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "A. Singh" <A. (E-Mail Removed)> wrote in message
> news:A26DC0A8-B324-4DA8-80E5-(E-Mail Removed)...
> >I have an Access 2003 DB where one of the columns contains multiple names
> > (10-15), seperated by special seperators that look like rectangular boxes.
> >
> > I want to sperate each name so that each appears in individual row/column
> > alongside.
> >
> > Kindly help.
> >
> > Thanks,
> >
> > A. Singh

>
>

 
Reply With Quote
 
E W
Guest
Posts: n/a
 
      3rd Apr 2007
use combinations of mid, left and righ functions to split out info. usiing
the "find" function to find a particular character that reoocurs in all the
data can help locate the starting character for the "mid" function. also the
"len" function can help to determine where to end or start a mid, left or
right function. help on these functions best found in google, ms help files
on functions are amazingly sparse and difficult to locate.
"Allen Browne" <(E-Mail Removed)> wrote in message
news:%23H%(E-Mail Removed)...
> Write a VBA function that opens 2 records:
> - the source table, with the concatenated field;
> - the target table that you want to add records to.
>
> Use the Split() function to parse the elements into an array.
> Loop through the array elements from LBound to Ubound.
> For each one, use AddNew and Update to add the records to the target
> table.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "A. Singh" <A. (E-Mail Removed)> wrote in message
> news:A26DC0A8-B324-4DA8-80E5-(E-Mail Removed)...
>>I have an Access 2003 DB where one of the columns contains multiple names
>> (10-15), seperated by special seperators that look like rectangular
>> boxes.
>>
>> I want to sperate each name so that each appears in individual row/column
>> alongside.
>>
>> Kindly help.
>>
>> Thanks,
>>
>> A. Singh

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
add two cells from seperate work sheets into a cell on seperate wo lar Microsoft Excel Worksheet Functions 6 27th Apr 2010 06:54 PM
Split string into seperate cells keri Microsoft Excel Programming 8 13th Apr 2007 03:16 PM
How to split Cell content into two resulting cells =?Utf-8?B?ci1oZWdnb2VAb25saW5lLm5v?= Microsoft Excel Worksheet Functions 1 23rd Oct 2006 12:30 PM
Re: How to seperate data in a cell which is split by a comma Microsoft Excel Worksheet Functions 0 29th Mar 2006 09:30 AM
Split Cell Into Seperate Rows Andibevan Microsoft Excel Programming 2 20th Dec 2005 06:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:49 PM.