Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Remove space from text in cell

First, I have a confession to make: I actually searched the available answers
first (using search text: "remove space from text in cell"). Nothing there
fit my simpler problem:

Cell G3 contains "Herkimer, Mortimer". I need to get rid of that space
("Herkimer,Mortimer") becaise I am about to search with the result into a
different WB where the data is stored without spaces.

My bet is that there's a really simple function for this <g!
--
Dave
Temping with Staffmark
in Rock Hill, SC
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default Remove space from text in cell

Do you have to have this done in VBA? If not, there is a very simple
built-in function you can use to acheive this. Assuming your text is
in cell A1, this formula will remove all empty spaces.
=SUBSTITUTE(A1," ","")

HTH


Dave Birley wrote:
First, I have a confession to make: I actually searched the available answers
first (using search text: "remove space from text in cell"). Nothing there
fit my simpler problem:

Cell G3 contains "Herkimer, Mortimer". I need to get rid of that space
("Herkimer,Mortimer") becaise I am about to search with the result into a
different WB where the data is stored without spaces.

My bet is that there's a really simple function for this <g!
--
Dave
Temping with Staffmark
in Rock Hill, SC


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Remove space from text in cell

Dave,

If it's specific enough that you're looking a comma followed by a space,
maybe the SUBSTITUTE function can help you.

=SUBSTITUTE(G3, ", ", ",")



--
Hope that helps.

Vergel Adriano


"Dave Birley" wrote:

First, I have a confession to make: I actually searched the available answers
first (using search text: "remove space from text in cell"). Nothing there
fit my simpler problem:

Cell G3 contains "Herkimer, Mortimer". I need to get rid of that space
("Herkimer,Mortimer") becaise I am about to search with the result into a
different WB where the data is stored without spaces.

My bet is that there's a really simple function for this <g!
--
Dave
Temping with Staffmark
in Rock Hill, SC

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default Remove space from text in cell

That there's the puppy I've been looking for!!! Bets the heck out of this mess:

=TRIM(LEFT(G4, FIND(", ",G4)))&MID(G4, (FIND(", ",G4)+2),12)

Thankee both!
--
Dave
Temping with Staffmark
in Rock Hill, SC


"Vergel Adriano" wrote:

Dave,

If it's specific enough that you're looking a comma followed by a space,
maybe the SUBSTITUTE function can help you.

=SUBSTITUTE(G3, ", ", ",")



--
Hope that helps.

Vergel Adriano


"Dave Birley" wrote:

First, I have a confession to make: I actually searched the available answers
first (using search text: "remove space from text in cell"). Nothing there
fit my simpler problem:

Cell G3 contains "Herkimer, Mortimer". I need to get rid of that space
("Herkimer,Mortimer") becaise I am about to search with the result into a
different WB where the data is stored without spaces.

My bet is that there's a really simple function for this <g!
--
Dave
Temping with Staffmark
in Rock Hill, SC

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Remove space from text in cell

Hi Dave,

If you're looking for a simple worksheet formula then SUBSTITUTE should work.

For your example write in a cell:
=SUBSTITUTE(G3," ","")



If you're using VBA then lookup the REPLACE method in the VBA help, that
should work for you.

Sean.

"Dave Birley" wrote:

First, I have a confession to make: I actually searched the available answers
first (using search text: "remove space from text in cell"). Nothing there
fit my simpler problem:

Cell G3 contains "Herkimer, Mortimer". I need to get rid of that space
("Herkimer,Mortimer") becaise I am about to search with the result into a
different WB where the data is stored without spaces.

My bet is that there's a really simple function for this <g!
--
Dave
Temping with Staffmark
in Rock Hill, SC

Reply
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
How do I remove extra space when text wrapping? chosen-girl[_2_] Excel Worksheet Functions 3 May 12th 23 11:44 AM
How do I remove extra space when text wrapping? chosen-girl Excel Discussion (Misc queries) 2 March 17th 09 07:25 PM
How do I remove a space infront of text in a cell? GAC Excel Discussion (Misc queries) 7 October 10th 06 01:41 AM
Remove Space in Text Tian Excel Discussion (Misc queries) 5 April 6th 06 07:09 PM
Function to remove a space from text in cell WITHOUT macro?? [email protected] Excel Worksheet Functions 5 May 28th 05 02:28 AM


All times are GMT +1. The time now is 08:35 PM.

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

About Us

"It's about Microsoft Excel"