Removing spaces in cells with data in it

We have a personnel roster that is kept in a database. Occasionally,
this roster is exported into Excel and sent out to members of the
department. In one column are dates that each person was employed. When
I try to sort the entire roster, it doesn't come up right because most
of the cells that contain the date have spaces in front of it.
Sometimes it's 1 or 2, sometime more, other times there are no spaces.

In order for me to sort the entire roster correctly, I'm having to
manually remove the spaces in front of the date, then sort the roster
according to date.
There are over 500 entries in this roster, is there a better way to
remove the spaces other than manually?

Thanx...


-- 
Ltat42a
------------------------------------------------------------------------
Ltat42a's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=24735
View this thread: http://www.excelforum.com/showthread.php?threadid=391784

0
8/1/2005 1:00:05 PM
excel.misc 78881 articles. 5 followers. Follow

7 Replies
644 Views

Similar Articles

[PageSpeed] 10

Ltat412a:

In a blank column, type this formula (this example assumes that the first 
date is in cell A2):

=trim(A2)

Then copy the formulat by double-clicking it down the 500 rows.  You can 
then copy this column "over itself" by selecting the column, copy and then 
paste special values.  You can then sort on that column.

"Ltat42a" wrote:

> 
> We have a personnel roster that is kept in a database. Occasionally,
> this roster is exported into Excel and sent out to members of the
> department. In one column are dates that each person was employed. When
> I try to sort the entire roster, it doesn't come up right because most
> of the cells that contain the date have spaces in front of it.
> Sometimes it's 1 or 2, sometime more, other times there are no spaces.
> 
> In order for me to sort the entire roster correctly, I'm having to
> manually remove the spaces in front of the date, then sort the roster
> according to date.
> There are over 500 entries in this roster, is there a better way to
> remove the spaces other than manually?
> 
> Thanx...
> 
> 
> -- 
> Ltat42a
> ------------------------------------------------------------------------
> Ltat42a's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=24735
> View this thread: http://www.excelforum.com/showthread.php?threadid=391784
> 
> 
0
Darlene (21)
8/1/2005 1:20:01 PM
Check out the TRIM function.  This will remove all spaces from a cel
(except single spaces between words)

Use a 'helper' column next to your data (insert if needed), use thi
formula (copied down your range):

=TRIM(A1)    

---- of course, adjust the range as needed to match your data'
location

You can then Hide or Delete the original column.

Does this work for you?

Bruce

tip: save your data before you attempt any altering process...just i
case..

--
swatsp0

-----------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1510
View this thread: http://www.excelforum.com/showthread.php?threadid=39178

0
8/1/2005 1:23:54 PM
What I have done in the past is an edit replace.  Highlight the column you 
wish to edit.  From the main menu click on Edit - replace.  When the box 
appears go to the replace tab.  Next to "find what:" put one space.  Next to 
"replace with:" leave it blank.  Then choose "Replace All".  This should 
remove all spaces.

"Ltat42a" wrote:

> 
> We have a personnel roster that is kept in a database. Occasionally,
> this roster is exported into Excel and sent out to members of the
> department. In one column are dates that each person was employed. When
> I try to sort the entire roster, it doesn't come up right because most
> of the cells that contain the date have spaces in front of it.
> Sometimes it's 1 or 2, sometime more, other times there are no spaces.
> 
> In order for me to sort the entire roster correctly, I'm having to
> manually remove the spaces in front of the date, then sort the roster
> according to date.
> There are over 500 entries in this roster, is there a better way to
> remove the spaces other than manually?
> 
> Thanx...
> 
> 
> -- 
> Ltat42a
> ------------------------------------------------------------------------
> Ltat42a's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=24735
> View this thread: http://www.excelforum.com/showthread.php?threadid=391784
> 
> 
0
Carrie (48)
8/1/2005 2:07:22 PM
carrie Wrote:
> What I have done in the past is an edit replace.  Highlight the colum
> you
> wish to edit.  From the main menu click on Edit - replace.  When th
> box
> appears go to the replace tab.  Next to "find what:" put one space.
> Next to
> "replace with:" leave it blank.  Then choose "Replace All".  Thi
> should
> remove all spaces.
> 
> "Ltat42a" wrote:
> 
> >
> > We have a personnel roster that is kept in a database. Occasionally,
> > this roster is exported into Excel and sent out to members of the
> > department. In one column are dates that each person was employed
> When
> > I try to sort the entire roster, it doesn't come up right becaus
> most
> > of the cells that contain the date have spaces in front of it.
> > Sometimes it's 1 or 2, sometime more, other times there are n
> spaces.
> >
> > In order for me to sort the entire roster correctly, I'm having to
> > manually remove the spaces in front of the date, then sort th
> roster
> > according to date.
> > There are over 500 entries in this roster, is there a better way to
> > remove the spaces other than manually?
> >
> > Thanx...
> >
> >
> > --
> > Ltat42a
> 
> ------------------------------------------------------------------------
> > Ltat42a's Profile
> http://www.excelforum.com/member.php?action=getinfo&userid=24735
> > View this thread
> http://www.excelforum.com/showthread.php?threadid=391784
> >
> >


Thanks everybody for replying. I tried several times using the TRI
function. I was having trouble with this because it would often retur
the text equilvalent of the date, it would not show the date.

I did try the replace idea, it seemed to work the best and removed al
the spaces and left the dates in place - Thanx

--
Ltat42
-----------------------------------------------------------------------
Ltat42a's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2473
View this thread: http://www.excelforum.com/showthread.php?threadid=39178

0
8/1/2005 5:13:21 PM
You are using Text functions therefore the result will be text.
You can probably hit F2 then enter,  if that fixes your date
then there are several ways of solving the problem to simulate
a reentry.  Include  selecting an empty cell, copying it Ctrl+C
then selecting the column or other cells to be reentered and
using Edit, paste special,  add.

But you would find it a lot easier to use a macro to remove
the leading and trailing spaces, or what would appear to be
spaces and essentially reenter their values.    See the
TRIMALL macro in
     http://www.mvps.org/dmcritchie/excel/join.htm#trimall

If you need it there is also a link pointing you to
    Getting Started with Macros and User Defined Functions
    http://www.mvps.org/dmcritchie/excel/getstarted.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel    [site changed  Nov. 2001]
My Excel Pages:  http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page:        http://www.mvps.org/dmcritchie/excel/search.htm

"Ltat42a" <Ltat42a.1t3kmd_1122919505.284@excelforum-nospam.com> wrote in message
news:Ltat42a.1t3kmd_1122919505.284@excelforum-nospam.com...
>
> carrie Wrote:
> > What I have done in the past is an edit replace.  Highlight the column
> > you
> > wish to edit.  From the main menu click on Edit - replace.  When the
> > box
> > appears go to the replace tab.  Next to "find what:" put one space.
> > Next to
> > "replace with:" leave it blank.  Then choose "Replace All".  This
> > should
> > remove all spaces.
> >
> > "Ltat42a" wrote:
> >
> > >
> > > We have a personnel roster that is kept in a database. Occasionally,
> > > this roster is exported into Excel and sent out to members of the
> > > department. In one column are dates that each person was employed.
> > When
> > > I try to sort the entire roster, it doesn't come up right because
> > most
> > > of the cells that contain the date have spaces in front of it.
> > > Sometimes it's 1 or 2, sometime more, other times there are no
> > spaces.
> > >
> > > In order for me to sort the entire roster correctly, I'm having to
> > > manually remove the spaces in front of the date, then sort the
> > roster
> > > according to date.
> > > There are over 500 entries in this roster, is there a better way to
> > > remove the spaces other than manually?
> > >
> > > Thanx...
> > >
> > >
> > > --
> > > Ltat42a
> > >
> > ------------------------------------------------------------------------
> > > Ltat42a's Profile:
> > http://www.excelforum.com/member.php?action=getinfo&userid=24735
> > > View this thread:
> > http://www.excelforum.com/showthread.php?threadid=391784
> > >
> > >
>
>
> Thanks everybody for replying. I tried several times using the TRIM
> function. I was having trouble with this because it would often return
> the text equilvalent of the date, it would not show the date.
>
> I did try the replace idea, it seemed to work the best and removed all
> the spaces and left the dates in place - Thanx!
>
>
> -- 
> Ltat42a
> ------------------------------------------------------------------------
> Ltat42a's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=24735
> View this thread: http://www.excelforum.com/showthread.php?threadid=391784
>


0
8/1/2005 9:12:55 PM
ASAP Utilities, a free Add-in, available at www.asap-utilities.com has a
feature that does this nicely.

Vaya con Dios,
Chuck, CABGx3



"Ltat42a" <Ltat42a.1t36qb_1122901506.4833@excelforum-nospam.com> wrote in
message news:Ltat42a.1t36qb_1122901506.4833@excelforum-nospam.com...
>
> We have a personnel roster that is kept in a database. Occasionally,
> this roster is exported into Excel and sent out to members of the
> department. In one column are dates that each person was employed. When
> I try to sort the entire roster, it doesn't come up right because most
> of the cells that contain the date have spaces in front of it.
> Sometimes it's 1 or 2, sometime more, other times there are no spaces.
>
> In order for me to sort the entire roster correctly, I'm having to
> manually remove the spaces in front of the date, then sort the roster
> according to date.
> There are over 500 entries in this roster, is there a better way to
> remove the spaces other than manually?
>
> Thanx...
>
>
> --
> Ltat42a
> ------------------------------------------------------------------------
> Ltat42a's Profile:
http://www.excelforum.com/member.php?action=getinfo&userid=24735
> View this thread: http://www.excelforum.com/showthread.php?threadid=391784
>


0
croberts (1377)
8/1/2005 9:27:55 PM
Thanx again for the replies, as for using macros, I get a whole ne
spreadsheet every so often, so, I'd have to create the macro just so 
can run it. For this, the find/replace would work just fine

--
Ltat42
-----------------------------------------------------------------------
Ltat42a's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2473
View this thread: http://www.excelforum.com/showthread.php?threadid=39178

0
8/7/2005 12:40:12 PM
Reply:

Similar Artilces:

Remove Excel Icon ??
Hi, I would like to remove the possibility to export data in Excel. I think I already read it's impossible but I just want to confirm. Thanks, Sylvie Your correct, there is no supported way to do this in the current release of Microsoft CRM 1.2 -- John O'Donnell Microsoft CRM MVP http://www.microsoft.com/BusinessSolutions/Community/CRMFaqLanding.aspx "sylvie" <sylvie.mondoux@proximi-t.com> wrote in message news:09dd01c47b03$d3627560$a301280a@phx.gbl... > Hi, > > I would like to remove the possibility to export data in > Excel. I think I already rea...

Adding data in a continuous form
Hi Guys, I have a blank continuous form to include some data, the thing is that when I finish the first line, I want to press enter and open a new line and include the second line and so on, but this is not happening, when I press nothing happen. I really appreciated if someone may help me with this. Thanks If it doesn't automatically add a new line, chances are your query or table is not editable. See if the arrow and asterisk at the bottom are highlighted. If not, they won't allow additions. -- Milton Purdy ACCESS State of Arkansas "Maracay&quo...

Removal
How do I completely remove all traces of Outlook 2002 for a complete fresh reinstall. I can't find anything for '02. HELP!!!!!!!!!!!!!!!!! ...

how do I remove spaces from cells that were pasted
I am pasting numbers into a spreadsheet, however its treating them as text because there is a space before the number. How do I remove the space so it treats it as a number ? I have used the =trim() function and its not working. Thanks for any help ! Hi! It sounds like you're copy/pasting from a website. Try this macro from David McRitchie. Look for TRIMALL, it's about half way down the page: http://www.mvps.org/dmcritchie/excel/join.htm Biff >-----Original Message----- >I am pasting numbers into a spreadsheet, however its treating them as text >because there is a...

Remove lines with +++
Is there anyway to find any line that has a + in it and delete that whole line?! I'd also like to do the same for *. I have a list of about 1300-1500 names and addresses. Some of them have a few +++ next to the name and some of them have a few *** next to the name. These were put there by the company to designate things. They need to be removed from the list, but it's a lost of work doing it one by one. You could apply an autofilter to the column with these characters in and from the pull-down select Custom - in the panel choose "Contains" (scroll down for this) the...

Non-positional cell formulas?
Ok, I have a spreadsheet with multiple columns, for example: Date | spanning header1 | spanner header2 | spanning header3 | Average header | | subhead1a | subhead1b | subhead2a | subhead2b | subhead3a | subhead3b | | date | s1adata | s1bdata | s2adata | s2bdata | s3adata | s3bdata | average s1a,s2a,s3a | Now for every row, I need to calculate the subtotal data. No problem with the formula (like in =AVERAGE(B3,D3,F3)). The next line's formula would be =AVERAGE(B4,D4,F4). The problem ...

How to Remove SRS
How to I remove or disable Site Replication Service (SRS) from my Exchange 2003? Thank You, Jason HI Remove the SRS by expanding the Tools node in ESM, right-clicking Site Replication Service, and clicking Delete "jpollock" wrote: > How to I remove or disable Site Replication Service (SRS) from my Exchange > 2003? > > Thank You, > > Jason > > And make sure you are doing it while logged in to the console of the Exchange server on which the SRS is running. -- Jim McBee Web: http://www.somorita.com Blog: http://mostlyexchange.blogspot.com &...

Update Query
I have a table made up of fields A, B, and C. I want to update the data in the table such that the value in fields C is placed in field A, and field C is set to null. thanks for the help -seems like this should be very simple. -- Bill Gable On Tue, 15 May 2007 12:46:01 -0700, Big Dog wrote: > I have a table made up of fields A, B, and C. I want to update the data in > the table such that the value in fields C is placed in field A, and field C > is set to null. thanks for the help -seems like this should be very simple. Back up your table first. Create an update query. Upd...

Copy field data to multiple places
Newbi here.... I have a access 07 file of about 1000 records (rows) and a field (column) I'll call the "project number". All the records do not have the project number inserted as of yet. Is there a simple means to insert a project number in say 50 records at a time, another project number in another 75 records etc. Copy/Paste will do it but may take months to enter. Any suggestions appreciated. TIA On Wed, 27 Feb 2008 15:31:05 -0500, "Meebers" <justme@idontkno.com> wrote: >Newbi here.... I have a access 07 file of about 1000 records (rows) and ...

allmost done with removing our 1st exchange 03 server
We are in the process of removing the 1st exchange server in our domain. Everything has been replicated over to a new server and all mailboxes have been moved. When we shut down the original server down, email still works great for 90% of the team. For the rest of us, when type the name of person to receive an email, outlook it still tries to resolve the name on the original server. I checked the profile on the users mailbox and it shows them pointing to the new server. Any suggestions would be appreciated. Try creating a new Outlook profile. Also, when you shut down you're...

Editing in a cell
I am having a problem with a newly created workbook. When I go to a cell that has data in it and try to add more data to the existing string I lose all the previous information. The work sheet that I am working in is protected and I have "edit directly in cell" checked in the options section. It is almost like my double click (as well as F2) are being treated as a single click. Thank you I figured it out. For some reason "Hide" is selected for the unlocked cells. "John English" wrote: > I am having a problem with a newly created workbook. > > Wh...

data validation challenge
Hi, I'd like to set up data validation so that the only data that can be entered into cells is twofold: 1. a number between 1980 and 2050 2. the text "Phase 2" or "Phase 3" I know how to do #1, but is there a way to also allow the text of #2, in place of #1? Either one or the other. Thanks, Harold One way: Allow: Custom Formula: =IF(ISNUMBER(A1),AND(A1>1980,A1<2050),OR(A1="Phase 2",A1="Phase 3")) In article <edRLW3CnEHA.3292@TK2MSFTNGP15.phx.gbl>, "HGood" <hcgood@hotmail.com> wrote: > Hi, > ...

remove Fax from address book?
Is there a way to stop showing Fax in the address book? I have a lot of fax numbers in my Contacts. I do not want to loose them - just not show them in the Address Book. thx Outlook considers fax numbers to be valid electronic addresses, since there are many client- and server-based components that can use such addresses. One method to hide fax numbers from the address book is to prefix the fax number with one or more letters (maybe B for business fax, H for home, O for other). If the fax number begins with a letter, Outlook won't show it in the address book. There are a couple of t...

DATA EXPORT
Hi, Can anyone tell me whats the easiest way to export ALL of my lead information into excel or Access. I have brought a new marketing list containing leads and want to deduplicate it against what we already have. I propose doing the following: 1. Import new list into Access 2. Export existing leads in MS CRM into Access 3. Duplicate check in Access 4. Delete the duplicates that originated from the new list 5. Import whats left over into MS CRM Can anyone think of a better/ easier way? Thanks Lee use advanced find to get a list of your lead data then hit export to excel or run a lead re...

Stacking data in a comment
How can I stack numeric data like 4.60 in a Comment.Text instead of vectorizing it? My current output looks like this: 3.50-2.75-3.68-4.25 etc. My current code is: Comment.Text Text:="" & (Range("F5").Comment.Text & "-" & Format(Range("F6"), "0.00")) Instead I would like to output: 3.50 2.75 3.68 4.25 Thank's ahead for any suggestion Separate your strings by vblf (linefeeds). comment.text text:="asdf" & vblf & "qwer" & vblf & "zxcv" Bobby wrote: > > How can I stack ...

How to refer to cells dependent on a specific variable
I'm making a contact list where I in sheet 2 want to take out specifi details from sheet 1 dependent on whether there is arranged a meetin with the company. In sheet 1 each company has a row and when i tick of "Meeting" from a validation list, I have put under contact result fo each company, I want a function that can take the relevant inf (company name, contact person, date of contact, etc) and put them i sheet 2. Do you have a suggestion? -- Krelle ----------------------------------------------------------------------- Kreller's Profile: http://www.excelforum.com/member.p...

Cannot Remove a program from Add Remove via remove.
I downloaded a program Fast At Last and it did not download properly and I could not remove it. Even System Restore did not remove it. The program is listed as 924PL32. Kept getting messages The feature you are trying to use is on a network resource that is unavailable. C:\dell\GC605. Seems Dell is the publisher but they would not give me free support on this issue. Any suggestions as to how I can remove the program? I believe it may be associated with spyware. When I ran spysweeper it removed some Rouge Security products but I still cannot remove this program. Cor...

Removing an item from menu
How can I remove an item from the menu and add some thing else. For instance, how can I remove inactive from the menu in contact page and put some other item with my own code behind it? You can hide the public views by simply creating a team (non used views or whatever you want to name it) and share the view to that team(done in the customize entity fields in the forms and views), this will make it a private view that only members of that team can see. You can also create new public or private views in the same place. "Amin" wrote: > How can I remove an item from the m...

Remove deduction code from payroll stub
Is it possible to remove just a single payroll deduction code from a payroll stub using 'Employee Checks Stub on Top-D'? For example, an employee has three deductions: Insurance, 401k, Medical. Would it be possible then to show insurance and 401k but leave medical off the check stub for all employees who have medical? Thanks in advance for your help! I don't believe so because the deduction field is an array so you'd have to know which array value. Even if you did, I don't think you can use arrays in report restrictions. -- Charles Allen, MVP "drose03...

code to make a block arrow point from cell A to cell B
Hello, I'm looking for a piece of code to make an existing shape (block arrow) point from one cell to another. I know how to refer to cells and their properties. It's just the shape that I don't know how to handle by vba. Could you give me a hand or a reference? Thanks Is this what you are wanting? Activecell.Value = ChrW(&H25BA) -- Cheers, Ryan "hermac" wrote: > Hello, > I'm looking for a piece of code to make an existing shape (block > arrow) point from one cell to another. I know how to refer to cells > and their propert...

reformat text in a cell
I have 2000+ cells that look like this: UK00001 Geddy Lee 2112 Bytor Ln GLENVIEW, IL 60025-1522 Is there a simple way to add a space after each line? right now when i paste it into a word doc, it shows like this : UK00001 Geddy Lee2112 Bytor LnGLENVIEW, IL 60025-1522 I would like to REFORMAT every cell to look like this with spaces in between to make it readable: UK00001 Geddy Lee 2112 Bytor Ln GLENVIEW, IL 60025-1522 any suggestions? ...

How to select other random cells
I have a 2 part question. I want to have a 1 question survey randomly filled out by 200 people. Column A lists the 1 questions. Columun b has ABCDE listed in cells B6 to b10. I would like 200 samples in columns c, d, e, etc. How do I set this up so that they randomly Coose B6 to B 10. Second part. On another spreadsheet, I have a similar situation, but the user has 10 answers to select from and I want them to randomly select all that apply. How would I do this? Thanks! ...

entering data into a premade form
I have a pre-made check request form. I need to print a form with certain data on each. such as name, agent number, and amount. I have a couple hundred of them to print (one ck request for each person). is there a way to print the forms and auto enter the name, agent number, and amount on each form? Thank You.... This would best be done in Word with Excel as the source for a mailmerge. Your form being the document in Word to merge to. But you can do it in Excel alone. John Walkenbach has a sample workbook on his site. http://spreadsheetpage.com/index.php/tip/mail_merge...

Need to remove selected characters
I have 25000 cells with map coordinates in it in the following format: N34* 51.87' I need the data in the following format: N55 13.26 So basically I need to strip out the * and ' from each cell. Any simple way to do this? I sure would appreciate any assistance. Thank you -- Dale Hi! Select the range of cells in question. Goto Edit>Rplace Find what: ~* Replace with: nothing, leave this blank Replace All Repeat the process for the ' It's VERY important that you select the specific range before you attempt this!!!!!!! Biff "Natedanger" <Natedanger@d...

How to Remove Yahoo toolbar
I have three toolbars installed on IE8-Yahoo (to the right of the address box), and Google and AVG below the address box. I want to uninstall the Yahoo toolbar but how? It is not listed under 'Add/Remove' programs and there is a magnifying glass and arrow to the right of this toolbar that says 'Manage search providers' so I removed Yahoo toolbar from there but it is still showing. I uninstalled Yahoo messenger (since the toolbar was included during the Messenger install so it would be removed by deleting Messenger) but it is still there. I know that for AV...