PC Review


Reply
Thread Tools Rate Thread

Delete part of cell contents

 
 
nxqviet
Guest
Posts: n/a
 
      20th Dec 2006
Hi everyone,

I have a large excel sheet with a column containing data that has a
following format:

ABC - Item1
BCDE - Item20
EDFGS - Item345

And I need to separate the wording of the cell without using the Text
To Columns approach. Specifically, I need to delete everything before
the "-" , keeping only the "Item#" part. The Text To Columns approach
will create another column next to the original one, which is why I
don't want to use it because their is a very complex macro in the file
that uses the data in the order they are in. Adding column will alter
the ranges and could cause problems.

Next to this data column, there is an empty column that I can use. I
can use the Left,Righ, or Mid Approach to set the value of the cell
next to it, but as you can see, the number of character in the prefix
as well as that of the string of interest are not constant. And excell
does not understand the Wild Card "*"...

I don't know what to do. I really don't want to rewrite the macro to
take into account the extra column.

Thanks for your help.

V

 
Reply With Quote
 
 
 
 
John Bundy
Guest
Posts: n/a
 
      20th Dec 2006
Try this, seems to state that you wanted to keep the - so i left it

=RIGHT(A1,FIND("-",A1))

"nxqviet" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi everyone,
>
> I have a large excel sheet with a column containing data that has a
> following format:
>
> ABC - Item1
> BCDE - Item20
> EDFGS - Item345
>
> And I need to separate the wording of the cell without using the Text
> To Columns approach. Specifically, I need to delete everything before
> the "-" , keeping only the "Item#" part. The Text To Columns approach
> will create another column next to the original one, which is why I
> don't want to use it because their is a very complex macro in the file
> that uses the data in the order they are in. Adding column will alter
> the ranges and could cause problems.
>
> Next to this data column, there is an empty column that I can use. I
> can use the Left,Righ, or Mid Approach to set the value of the cell
> next to it, but as you can see, the number of character in the prefix
> as well as that of the string of interest are not constant. And excell
> does not understand the Wild Card "*"...
>
> I don't know what to do. I really don't want to rewrite the macro to
> take into account the extra column.
>
> Thanks for your help.
>
> V
>



 
Reply With Quote
 
John Bundy
Guest
Posts: n/a
 
      20th Dec 2006
This gets rid of the - and leaves the rest

=RIGHT(A1,FIND("-",A1,1)-1)

"nxqviet" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi everyone,
>
> I have a large excel sheet with a column containing data that has a
> following format:
>
> ABC - Item1
> BCDE - Item20
> EDFGS - Item345
>
> And I need to separate the wording of the cell without using the Text
> To Columns approach. Specifically, I need to delete everything before
> the "-" , keeping only the "Item#" part. The Text To Columns approach
> will create another column next to the original one, which is why I
> don't want to use it because their is a very complex macro in the file
> that uses the data in the order they are in. Adding column will alter
> the ranges and could cause problems.
>
> Next to this data column, there is an empty column that I can use. I
> can use the Left,Righ, or Mid Approach to set the value of the cell
> next to it, but as you can see, the number of character in the prefix
> as well as that of the string of interest are not constant. And excell
> does not understand the Wild Card "*"...
>
> I don't know what to do. I really don't want to rewrite the macro to
> take into account the extra column.
>
> Thanks for your help.
>
> V
>



 
Reply With Quote
 
nxqviet
Guest
Posts: n/a
 
      20th Dec 2006
John,

It worked perfectly...Thanks so much, I don't have to rewrite my macro
now..thanks.

Viet


John Bundy wrote:
> This gets rid of the - and leaves the rest
>
> =RIGHT(A1,FIND("-",A1,1)-1)
>
> "nxqviet" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi everyone,
> >
> > I have a large excel sheet with a column containing data that has a
> > following format:
> >
> > ABC - Item1
> > BCDE - Item20
> > EDFGS - Item345
> >
> > And I need to separate the wording of the cell without using the Text
> > To Columns approach. Specifically, I need to delete everything before
> > the "-" , keeping only the "Item#" part. The Text To Columns approach
> > will create another column next to the original one, which is why I
> > don't want to use it because their is a very complex macro in the file
> > that uses the data in the order they are in. Adding column will alter
> > the ranges and could cause problems.
> >
> > Next to this data column, there is an empty column that I can use. I
> > can use the Left,Righ, or Mid Approach to set the value of the cell
> > next to it, but as you can see, the number of character in the prefix
> > as well as that of the string of interest are not constant. And excell
> > does not understand the Wild Card "*"...
> >
> > I don't know what to do. I really don't want to rewrite the macro to
> > take into account the extra column.
> >
> > Thanks for your help.
> >
> > V
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Picking part of a cell based on cell contents a.t.brooks@talk21.com Microsoft Excel Programming 7 25th Jul 2008 12:19 PM
Lookup part of a cell's contents and return value of entire cell Terri Microsoft Excel Misc 2 21st Feb 2008 03:53 AM
macro to move part of cell contents to another cell =?Utf-8?B?aWNldG9hZCAgaGlzc2VsZg==?= Microsoft Excel Misc 4 27th Nov 2006 07:19 PM
Display contents of cell in another cell as part of text string? mschmidt@carolina.rr.com Microsoft Excel New Users 3 8th Jul 2006 07:44 PM
Macro to delete part of cell contents Hugo Sondermeijer Microsoft Excel Misc 3 19th Aug 2003 11:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:12 AM.