Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Tom Tom is offline
external usenet poster
 
Posts: 17
Default Removing spaces in cell

Hello,

When importing external data into excel, I end up with 2 blank spaces
before the data. Need to remove the 2 blanks spaces for all the cells
in that column. Changed the format and tried decreasing indent,
neither worked.

Is there a formula or VBA code that would work?

Thanks,
Tom

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default Removing spaces in cell

Hi Tom

If you are sure it is always 2 spaces, then in another column enter
=MID(A1,3,255)
and copy down
When finished copy your new column and Paste SpecialValues back over
the original data to "fix the data".
The helper column can then be deleted.

Alternatively, if the data doesn't have other spaces within the source
cells you could use
=SUBSTITUTE(A1," ","")
and repeat as above.

--
Regards

Roger Govier


"Tom" wrote in message
oups.com...
Hello,

When importing external data into excel, I end up with 2 blank spaces
before the data. Need to remove the 2 blanks spaces for all the cells
in that column. Changed the format and tried decreasing indent,
neither worked.

Is there a formula or VBA code that would work?

Thanks,
Tom



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Removing spaces in cell

use the TRIM() function
--
Gary's Student
gsnu200703


"Tom" wrote:

Hello,

When importing external data into excel, I end up with 2 blank spaces
before the data. Need to remove the 2 blanks spaces for all the cells
in that column. Changed the format and tried decreasing indent,
neither worked.

Is there a formula or VBA code that would work?

Thanks,
Tom


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Removing spaces in cell

Here's a link to a nice little macro that's perfect for this:

http://www.mvps.org/dmcritchie/excel/join.htm#trimall

Biff

"Tom" wrote in message
oups.com...
Hello,

When importing external data into excel, I end up with 2 blank spaces
before the data. Need to remove the 2 blanks spaces for all the cells
in that column. Changed the format and tried decreasing indent,
neither worked.

Is there a formula or VBA code that would work?

Thanks,
Tom



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Tom Tom is offline
external usenet poster
 
Posts: 17
Default Removing spaces in cell

Got it working with the macro. Tried the =MID(A1,3,255) but didn't
work for me as needed.

Thanks to all,
Tom


On Jan 29, 2:33 pm, "T. Valko" wrote:
Here's a link to a nice little macro that's perfect for this:

http://www.mvps.org/dmcritchie/excel/join.htm#trimall

Biff

"Tom" wrote in ooglegroups.com...



Hello,


When importing external data into excel, I end up with 2 blank spaces
before the data. Need to remove the 2 blanks spaces for all the cells
in that column. Changed the format and tried decreasing indent,
neither worked.


Is there a formula or VBA code that would work?


Thanks,
Tom- Hide quoted text -- Show quoted text -


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
Sumproduct issues SteveDB1 Excel Worksheet Functions 25 June 3rd 09 04:58 PM
Help with this conditional IF statement C-Dawg Excel Discussion (Misc queries) 3 May 15th 06 06:01 PM
CELL IS BLANK BUT NEED IT FILLED WITH SPACES TO A SPECIFIC LENGTH מיכאל (מיקי) אבידן Excel Worksheet Functions 0 August 29th 05 09:55 PM
cell color index comparison MINAL ZUNKE New Users to Excel 1 June 30th 05 07:11 AM
Removing Spaces in a Cell carl Excel Worksheet Functions 2 October 28th 04 11:34 PM


All times are GMT +1. The time now is 02:28 AM.

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"