From: andrei on

Hi guys !

I have a lot of cells with text , empty spaces etc . All cells contain
a "," (comma) . I need a macro that delets all after that comma ,
including comma . I give in example :

A1 : mother, father

The result should be :

A1 : mother

Many thanks !


--
andrei
------------------------------------------------------------------------
andrei's Profile: 1056
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=193313

http://www.thecodecage.com/forumz

From: Don Guillett on
Look in the vba help index for INSTRREV

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett(a)gmail.com
"andrei" <andrei.4903v4(a)thecodecage.com> wrote in message
news:andrei.4903v4(a)thecodecage.com...
>
> Hi guys !
>
> I have a lot of cells with text , empty spaces etc . All cells contain
> a "," (comma) . I need a macro that delets all after that comma ,
> including comma . I give in example :
>
> A1 : mother, father
>
> The result should be :
>
> A1 : mother
>
> Many thanks !
>
>
> --
> andrei
> ------------------------------------------------------------------------
> andrei's Profile: 1056
> View this thread:
> http://www.thecodecage.com/forumz/showthread.php?t=193313
>
> http://www.thecodecage.com/forumz
>

From: Dave Peterson on
If you want to get rid of everything after the first (or only) comma, you could
record a macro when:

You select the range to fix
edit|replace
what: ,* (comma followed by an asterisk)
with: (leave blank)
replace all

Be aware that if your data looks like this before:
asdf,qwer,1234,erty
then you'll end up with:
asdf
when you're done.



andrei wrote:
>
> Hi guys !
>
> I have a lot of cells with text , empty spaces etc . All cells contain
> a "," (comma) . I need a macro that delets all after that comma ,
> including comma . I give in example :
>
> A1 : mother, father
>
> The result should be :
>
> A1 : mother
>
> Many thanks !
>
> --
> andrei
> ------------------------------------------------------------------------
> andrei's Profile: 1056
> View this thread: http://www.thecodecage.com/forumz/showthread.php?t=193313
>
> http://www.thecodecage.com/forumz

--

Dave Peterson
From: andrei on

Yep , it works . Many thanks


--
andrei
------------------------------------------------------------------------
andrei's Profile: 1056
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=193313

http://www.thecodecage.com/forumz