LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Removing Space

If your data is in a single column, and you could get rid of leading and
trailing spaces, you could use:

Select the column
Data|Text to columns
Fixed width
(Remove any lines that excel guessed)
and finish up

If you have lots of columns, you can do the same thing for each column.

Record a macro when you test it manually to see the code.

(This'll be a lot quicker.)

Tom wrote:

On Feb 26, 1:58 pm, "Richard O. Neville"
wrote:
Spaces don't normally occur in Excel cells except in text entries. If your
problem is that they are really spaces, you can remove them with the Replace
function. Search for (type in a space) and Replace with (nothing--leave box
empty). Be sure not to delete spaces in the text entries. If they aren't
really spaces entered with the spacebar, you may have to look for a
different number format (Format-Cells).

"Tom" wrote in message

ups.com...



Hello - When I import data, there is a space in front of the first
character in a cell. Would like to know if there is a visual basic
code to remove this space. I already have a code which removes all
spaces, now need code to remove the first space and leaves the other
spaces in place.
Thanks,
Tom- Hide quoted text -


- Show quoted text -


I got Dave's code to run (though chugs a little???). When I tried
using the "Find Replace" it removed all spaces. Just wanted the first
spaces removed.

Thanks to both of you for helping me. Much appreciated.
Tom


--

Dave Peterson
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing Space KL Cheong Excel Discussion (Misc queries) 7 April 28th 06 07:32 AM
NEED HELP-----Removing a space at the end of a string of character FRS Excel Discussion (Misc queries) 7 April 13th 06 03:57 AM
removing a space between words in a cell JenBasch Excel Worksheet Functions 3 September 20th 05 12:39 AM
Removing a space after a comma DebbieK9 New Users to Excel 3 April 1st 05 10:08 PM
Removing a space within a cell JERRY8 Excel Worksheet Functions 3 December 2nd 04 03:22 AM


All times are GMT +1. The time now is 12:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"