View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Otto Moehrbach[_2_] Otto Moehrbach[_2_] is offline
external usenet poster
 
Posts: 1,071
Default Replacing multiple instances of character

Colin
Say that your data is in Column B starting in B2. In C2 enter the formula:
=Trim(B2)
Using the fill handle (the little square in the bottom right corner of a
selected cell) drag this formula down as far as the Column B data goes.
Now copy all of the occupied cells in Column C and PasteSpecial into B2.
When you select PasteSpecial, you will get a small menu. Click on Values
and click OK. Now delete all of Column B.
What this produces is all the leading and trailing spaces will be deleted as
well as all spaces but one between words.
HTH Otto

"Colin Foster" wrote in message
...
Hi,
Trying to sort out a spreadsheet that someone's given me... a type-up of a
WW2 pilot's logbook.

For one set of information (pilot flying times) has been typed in a single
column using the Spacebar to line up the 4 columns of data (rather than
using
4 separate columns).

So, what I want to do is to convert this. So, what I thought was to
replace
the spaces with a single comma between each set of data which I could then
do
a data parse to separate. Unfortunately, there are various number of
spaces
between each of the sets of data, so any suggestions of a quick way of
doing
this?

The way that I thought was to use the SUBSTITUTE function & somehow use a
*
wildcard to allow it to deal with different numbers of spaces, but either
I'm
doing it wrong, or it can't be done that way.

Any suggestions?

Cheers from a snowy & cold Manchester!