Solved

How can I remove blank spaces in Excel?

Posted on 2002-03-21
3
4,113 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 100 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

631 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