Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Spaces in a cell


Hi

is there a way to check if a cell has spaces in it ?

If there is then can we remove the spaces.

for eg.

Logan Central Plaza ... <--- how can i remove the spaces to make it

LoganCentralPlaza please

Any idea

Thanks


--
kush2
-----------------------------------------------------------------------
kush28's Profile: http://www.excelforum.com/member.php...fo&userid=3103
View this thread: http://www.excelforum.com/showthread.php?threadid=51560

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Spaces in a cell

On Wed, 22 Feb 2006 22:11:01 -0600, kush28
wrote:


Hi

is there a way to check if a cell has spaces in it ?

If there is then can we remove the spaces.

for eg.

Logan Central Plaza ... <--- how can i remove the spaces to make it

LoganCentralPlaza please

Any idea

Thanks
K


=SUBSTITUTE(A1," ","")


--ron
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Spaces in a cell

To test whether a cell contains space, e.g. cell a1,

Dim a as boolean
If instr(Range("A1").value," ") < 0 then
a = true
else
a = false
end if

To remove all space in the selected cells,
Selection.Cells.Replace What:=" ", Replacement:=""


Regards,
Edwin Tam

http://www.vonixx.com

"kush28" wrote:


Hi

is there a way to check if a cell has spaces in it ?

If there is then can we remove the spaces.

for eg.

Logan Central Plaza ... <--- how can i remove the spaces to make it

LoganCentralPlaza please

Any idea

Thanks
K


--
kush28
------------------------------------------------------------------------
kush28's Profile: http://www.excelforum.com/member.php...o&userid=31036
View this thread: http://www.excelforum.com/showthread...hreadid=515607


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Spaces in a cell

Please try

=trim(a1)

Thanks




kush28 wrote:
Hi

is there a way to check if a cell has spaces in it ?

If there is then can we remove the spaces.

for eg.

Logan Central Plaza ... <--- how can i remove the spaces to make it

LoganCentralPlaza please

Any idea

Thanks


--
purplemx

Message posted via http://www.officekb.com
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Spaces in a cell


thanx....

--
Pivotren
-----------------------------------------------------------------------
Pivotrend's Profile: http://www.excelforum.com/member.php...nfo&userid=406
View this thread: http://www.excelforum.com/showthread.php?threadid=51560



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 leading spaces and leave the remianing spaces w Debi Excel Worksheet Functions 6 February 28th 07 03:29 PM
how do I delete the last two spaces in a cell brantty Excel Discussion (Misc queries) 2 July 27th 06 01:14 AM
Adding spaces to a cell catalfamo1220 Excel Discussion (Misc queries) 3 July 18th 06 04:03 PM
Remove all spaces in a cell... killertofu Excel Worksheet Functions 8 February 20th 06 08:17 PM
Add spaces to cell noyb[_3_] Excel Programming 8 July 26th 05 06:37 PM


All times are GMT +1. The time now is 10:52 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"