How to get rid of spaces only in empty cells?

  • Thread starter Thread starter hce
  • Start date Start date
H

hce

Hi All Excel Experts

I have to deal with excel databases at time and after processing th
databases, I need to send them to another person where he would us
them to generate results. However for the software to work properly, m
databases cannot have spaces in empty cells. Hence, my question woul
be how can I get rid of spaces only in empty cells? I cannot find an
replace all cells because I have some cells which contain text and i
the spaces between the sentences are gone, the text wouldn't make an
sense. Kindly help me!!!

Cheer
 
If it's just single spaces (or a given, constant number of spaces), you can
use the find and replace fuctionality, checking the Entire Cells Only
checkbox.
If the number of spaces varies, then you need to either repeat the process
for each different number of spaces, or address your problem through a macro
(requires some VB code).

HTH,
Nikos
 
Hi

When you truely have only some cells containing text, then select the whole
sheet, hold down Ctrl key, and deselect all cells you want to left
unchanged. After that use ReplaceAll with " " to search for and nothing to
replace with.
 
Hi hce
You can use the TRIM function in a helper column. This function is normally used to reduce multiple spaces within a text string to single spaces. However, if a cell has only spaces in it, the function will remove all of them. Then you can Copy and Paste_Special>Values to change the formulas into numbers

Good Luck
Mark Graesse
(e-mail address removed)
Boston M

----- Nikos Yannacopoulos wrote: ----

If it's just single spaces (or a given, constant number of spaces), you ca
use the find and replace fuctionality, checking the Entire Cells Onl
checkbox
If the number of spaces varies, then you need to either repeat the proces
for each different number of spaces, or address your problem through a macr
(requires some VB code)

HTH
Niko
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top