473,396 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

code for splitting a cell (space being the deliminator)

Hi all, can anyone help. i have a spreasheet (set up by a looney)
they have in the surname field, the surname then forename. What sort
of code would i need to use to sort this out.

It looks like this:

|Smith Bill |14 Any Street|
|Doe John |19 High Stree|

and so on (there are 7891 of them). Would make life a lot easier to
run it in a module but cant for the life of me work out how to do it
(DUH!!!).

Thanks in advance.

Bill

bill underscore nirl at hotmail.com is my email :)
bi*******@hotmail.com or post it here :)

Aug 7 '06 #1
4 2326
On 7 Aug 2006 13:04:46 -0700, bill_nirl wrote:
Hi all, can anyone help. i have a spreasheet (set up by a looney)
they have in the surname field, the surname then forename. What sort
of code would i need to use to sort this out.

It looks like this:

|Smith Bill |14 Any Street|
|Doe John |19 High Stree|

and so on (there are 7891 of them). Would make life a lot easier to
run it in a module but cant for the life of me work out how to do it
(DUH!!!).

Thanks in advance.

Bill

bill underscore nirl at hotmail.com is my email :)
bi*******@hotmail.com or post it here :)
A cell?
Spreadsheet?
Excel?
You have posted this message to the wrong newsgroup.
The access in this groups name refers to Microsoft Access, a database
program.
Please repost to the correct newsgroup for the Excel program you are
using. I would suggest you include your Windows and Office version
number in the message.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Aug 7 '06 #2
Thank you for your reply fred, no use at all, but thank you anyway.

I have imported the spreadsheet into access (access 97 as i prefer to
work with it, less wizards than the newer versions) so that i may do an
export as a csv file or indeed keep the data in access to enable
quicker and easier data manipulation (and link directly to word as a
mail merge file if required)

The bit of vb code that i was looking would take the space as being the
deliminated point and use to the left of it as the cell in the table.

I have the code for using the right hand side of the space to give me
the Forenames, but was hoping for the left hand side (which is not as
simple as i thought).

Once i have worked out the module, i will then run and update query to
populate a new table and remove or archive the old table.

I thought this was a simple question and if anyone would like the code
to work out the right side of the space as a new field, you are welcome
to it.........

fredg wrote:
On 7 Aug 2006 13:04:46 -0700, bill_nirl wrote:
Hi all, can anyone help. i have a spreasheet (set up by a looney)
they have in the surname field, the surname then forename. What sort
of code would i need to use to sort this out.

It looks like this:

|Smith Bill |14 Any Street|
|Doe John |19 High Stree|

and so on (there are 7891 of them). Would make life a lot easier to
run it in a module but cant for the life of me work out how to do it
(DUH!!!).

Thanks in advance.

Bill

bill underscore nirl at hotmail.com is my email :)
bi*******@hotmail.com or post it here :)

A cell?
Spreadsheet?
Excel?
You have posted this message to the wrong newsgroup.
The access in this groups name refers to Microsoft Access, a database
program.
Please repost to the correct newsgroup for the Excel program you are
using. I would suggest you include your Windows and Office version
number in the message.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Aug 7 '06 #3
On 7 Aug 2006 15:09:58 -0700, bill_nirl wrote:
Thank you for your reply fred, no use at all, but thank you anyway.

I have imported the spreadsheet into access (access 97 as i prefer to
work with it, less wizards than the newer versions) so that i may do an
export as a csv file or indeed keep the data in access to enable
quicker and easier data manipulation (and link directly to word as a
mail merge file if required)

The bit of vb code that i was looking would take the space as being the
deliminated point and use to the left of it as the cell in the table.

I have the code for using the right hand side of the space to give me
the Forenames, but was hoping for the left hand side (which is not as
simple as i thought).

Once i have worked out the module, i will then run and update query to
populate a new table and remove or archive the old table.

I thought this was a simple question and if anyone would like the code
to work out the right side of the space as a new field, you are welcome
to it.........

fredg wrote:
>On 7 Aug 2006 13:04:46 -0700, bill_nirl wrote:
>>Hi all, can anyone help. i have a spreasheet (set up by a looney)
they have in the surname field, the surname then forename. What sort
of code would i need to use to sort this out.

It looks like this:

|Smith Bill |14 Any Street|
|Doe John |19 High Stree|

and so on (there are 7891 of them). Would make life a lot easier to
run it in a module but cant for the life of me work out how to do it
(DUH!!!).

Thanks in advance.

Bill

bill underscore nirl at hotmail.com is my email :)
bi*******@hotmail.com or post it here :)

A cell?
Spreadsheet?
Excel?
You have posted this message to the wrong newsgroup.
The access in this groups name refers to Microsoft Access, a database
program.
Please repost to the correct newsgroup for the Excel program you are
using. I would suggest you include your Windows and Office version
number in the message.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
I would guess that the address (|14 Any Street|) is actually in a
different field.
If you are using Access, and ALL of the data is in the order of
LastName space FirstName, then:

LastName:Left([ullName],InStr([FullName]," ")-1)
FirstName:Mid([FullName],InStr([FullName]," ")+1)

Of course the above will fail if some of the names are like:
van der Meer Joseph
von Newman Carl
etc.

in which case you will need to alter your data and insert a comma
between last and first names.
Then you can use the above expressions, substituting "," for " " in
the above.

You could run a select query (which does not save the data)
or an Update query (which does), i.e:

Update YourTable Set YourTable.LastName =
Left([FullName],InStr([FullName]," ")-1), YourTable.FirstName =
Mid([FullName],InStr([FullName]," ")+1);

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Aug 7 '06 #4
On 7 Aug 2006 13:04:46 -0700, "bill_nirl" <bi*******@hotmail.com>
wrote:

Check out my earlier reply to a similar question:
http://groups.google.com/group/comp....0a8a9a5bfeed45

-Tom.

>Hi all, can anyone help. i have a spreasheet (set up by a looney)
they have in the surname field, the surname then forename. What sort
of code would i need to use to sort this out.

It looks like this:

|Smith Bill |14 Any Street|
|Doe John |19 High Stree|

and so on (there are 7891 of them). Would make life a lot easier to
run it in a module but cant for the life of me work out how to do it
(DUH!!!).

Thanks in advance.

Bill

bill underscore nirl at hotmail.com is my email :)
bi*******@hotmail.com or post it here :)
Aug 8 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: MattB | last post by:
Hello please help, I have a table cell with a div in it. The div has a width of 300px. but when it is rendered it puts extra space into the table cell. Here's the style <style>...
31
by: Arthur Shapiro | last post by:
I'm the webmaster for a recreational organization. As part of one page of the site, I have an HTML "Calendar at a Glance" of the organization's events for the month. It's a simple table of a...
20
by: Opettaja | last post by:
I am new to c# and I am currently trying to make a program to retrieve Battlefield 2 game stats from the gamespy servers. I have got it so I can retrieve the data but I do not know how to cut up...
4
by: Hiwj | last post by:
I am having a problem with a cell in a table in ASP.NET which used to work OK in classic ASP. I have one cell in a row where the width should be 22 pixels and the other cell should take up the...
2
by: Yeah | last post by:
Hi, all! I have a question. I am designing a listing similar to a phone book in HTML. Each listing has periods following it, but they must extend to the end of the table cell, and not wrap. ...
6
by: McKirahan | last post by:
I an using ASP to read a database table and generate an HTML table which is save via FSO with a file extension of .xls which opens up in MS-Excel. I am inserting several lines of text into a cell...
7
by: =?iso-8859-2?Q?K=F8i=B9tof_=AEelechovski?= | last post by:
How do I split a title attribute value into lines within the source code so that the paragraph gets reassembled by the browser when it is being displayed? Microsoft Internet Explorer 7 preserves...
0
by: HughManity | last post by:
I was sent an Excel xls file where the Address column consists of up to 3 address lines stacked on top on each other - all in one cell. If there is more than one line in a cell, then all but the...
1
by: chris f | last post by:
I'm dynamically populating a Table control in ASP.NET 2. Each row has 4 columns but column #3 needs to be split into 3 rows and column #4 needs to be split into 4 rows. Each of these cells contains...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.