Trim help please

G

Guest

How can I trim the last space from text but leave the other spaces intact
ie:- Red Lancer (IRE) Red Lancer(IRE)
Torrent (IRE) Torrent(IRE)

Sir Edward Landseer (FR) Sir Edward Landseer (FR)

I've tried =SUBSTITUTE(A1," ","") but this trims all the spaces out.
Any help will be welcomed.
 
D

David McRitchie

G

Guest

Hi David
Thanks for your help, i've tried your TRIMALL Macro you suggested but unable
to make it work. Error message "THAT NAME NOT VALID" when I run the Macro.
Any further assistance you can give me would be appreciated.
 
G

Guest

Hi Roger
Thanks for your help.
Your formula worked perfectly with all the names with (---) brackets but
those without brackets showed "#VALUE!" i'm sorry about that I should have
mentioned that.
Is there a way around this.
Any further help with this problem would be appreciated.
regards
Dave
 
D

David McRitchie

Hi Dave,
I think the error "that name is not valid" but I couldn't find what triggers
such an error.

Are you running other macros okay.
What version of Excel.
Did you modify the macro.

If you are using Excel 95 change xlCalculationAutomatic to xlAutomatic
 
R

Roger Govier

Hi Dave

Try
=IF(ISERROR(FIND("(",A1)),A1,LEFT(A1,FIND("(",A1)-2)&MID(A1,FIND("(",A1),255))
 
G

Guest

Hi David
Thanks again.
I'm running Excel 2003, and the TRIMALL Macro is running in its own workbook.
The only alteration I made to the macro was that I put "Option Explicit"
above the Sub TRIMALL.
regards
Dave
 
G

Guest

Hi Roger
Your a genius !! it works perfectly now.
Thanks once again for your help.
regards
Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top