Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How can I remove blank spaces in Excel?

Posted on 2002-03-21
3
Medium Priority
?
4,116 Views
Last Modified: 2008-03-17
I have a very large file I imported into Excel but am having problems sorting it because many entries in cells begin with a space. How can I mass remove these unwanted spaces?
0
Comment
Question by:RAE
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 44

Expert Comment

by:bruintje
ID: 6887205
Hi RAE,

-lets say data start at row 2
-you can insert a column in front of the offending column say column A which will then become the B column
-then add this formula =LTRIM(B2) to the new column in A2
-now copy this formula down till the end of the column to trim
-to round it up select column A completely choose copy
-then goto the second column choose paste special | only values
-then delete the first column again

be sure to make a copy first of this sheet but it will work like this

HTH:Bruintje
0
 
LVL 5

Accepted Solution

by:
jklmn earned 400 total points
ID: 6887233
Hi RAE,

If you don't mind using VBA, you can select the range with the data in your sheet and run this simple code:

Sub Trim()
For Each acell In Selection.Cells
acell.Value = LTrim(acell.Value)
Next
End Sub
0
 

Author Comment

by:RAE
ID: 6887287
Thanks very much! It worked very well. (When I tried bruintje version I kept getting a #NAME? error)
0

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question