LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Remove blanks from text

sorry, i guess i misunderstood. you can use this formula in a cell

=LEFT(A1,SEARCH(" ",A1,1)-1)

--


Gary


"Delboy" wrote in message
...
Thanks, but doesn't this just remove the space? I need it to remove the
space and any character(s) that appear after the space eg. S1 4 needs to
be
S1 etc.

"Gary Keramidas" wrote:

try this, you can shorten the range if you like

For Each cell In Range("a:a")
cell.Value = Replace(cell.Value, " ", "")
Next

--


Gary


"Delboy" wrote in message
...
Hi,

I have a column which contains postcodes to the first 4 characters,
these
are then trimed to get rid of any padding:

np7
LS2
S1 4
etc

I'm then using this column to lookup from another list of the first
parts
of
postcodes i.e. could be first 3 or 4 characters etc. My problem
appears
with
the last one in my example list eg S1 4.

The problem is that the list that I'm comparing sees S1 4 as S1 and
hence
doesn't return the correct value. How can I remove the space and any
characters that appear after it i.e. make S1 4 into S1 etc? There are
others
like this in a long list.







 
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
remove duplicates except blanks jat Excel Worksheet Functions 2 December 11th 09 12:25 PM
remove blanks using formula Gotroots Excel Worksheet Functions 5 December 9th 09 10:52 AM
Concatenate and remove blanks PeterW Excel Worksheet Functions 3 January 19th 06 06:04 PM
Remove blanks from list via VBA TheRobsterUK[_8_] Excel Programming 3 November 17th 05 06:10 AM
Macro to remove blanks in text herve Excel Programming 4 October 5th 05 02:33 AM


All times are GMT +1. The time now is 09:35 AM.

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"