PC Review


Reply
Thread Tools Rate Thread

automation to remove certain characters from a cell

 
 
srosetti
Guest
Posts: n/a
 
      12th Nov 2009
I have 2 column's that I wish to remove certain data from. The cells
have various lengths in data, but each column starts and ends with a
certain char I want to remove.

For instance in Column B the cell data starts and ends with a " sign.
I need these removed.

In Column C the cells all start with a " sign and end with a ");
These symbols need to be removed from the respective column data. I
have over 50,000 entries so..this is why I'm looking to automate it
with either a macro, vba, direct excel solution etc.


Any Ideas on the problem at hand?


Thanks
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      13th Nov 2009
Show sample data or
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(E-Mail Removed)
"srosetti" <(E-Mail Removed)> wrote in message
news:2407a256-2547-4cab-9585-(E-Mail Removed)...
>I have 2 column's that I wish to remove certain data from. The cells
> have various lengths in data, but each column starts and ends with a
> certain char I want to remove.
>
> For instance in Column B the cell data starts and ends with a " sign.
> I need these removed.
>
> In Column C the cells all start with a " sign and end with a ");
> These symbols need to be removed from the respective column data. I
> have over 50,000 entries so..this is why I'm looking to automate it
> with either a macro, vba, direct excel solution etc.
>
>
> Any Ideas on the problem at hand?
>
>
> Thanks


 
Reply With Quote
 
marcus
Guest
Posts: n/a
 
      13th Nov 2009
Hi srosetti

My first port of call would be to use a find and replace All. Or is
that too simplistic, is there more symbols in the column than just "
and ");

Assuming for Col C there is only three characters as a suffix then you
could use something like this and modify the formula for Col B.

Assumes data strarts in Cell C2.


=MID(C2,1,LEN(C2)-3)

Take care

Marcus
 
Reply With Quote
 
Per Jessen
Guest
Posts: n/a
 
      13th Nov 2009
Hi

In an unused column use this formula to remove first and last letter
from C1:

=MID(C1,2,LEN(C1)-2)

Drag the formula to next column, then drag down the formula to last
data cell.

If you then want to the formula result to values, copy the formula
colunms and use Paste Special / Values.

Hopes this helps.

Per

On 13 Nov., 00:54, srosetti <thromb...@gmail.com> wrote:
> I have 2 column's that I wish to remove certain data from. *The cells
> have various lengths in data, but each column starts and ends with a
> certain char I want to remove.
>
> For instance in Column B the cell data starts and ends with a " sign.
> I need these removed.
>
> In Column C the cells all start with a " sign and end with a ");
> These symbols need to be removed from the respective column data. *I
> have over 50,000 entries so..this is why I'm looking to automate it
> with either a macro, vba, direct excel solution etc.
>
> Any Ideas on the problem at hand?
>
> Thanks


 
Reply With Quote
 
srosetti
Guest
Posts: n/a
 
      13th Nov 2009
On Nov 12, 5:08*pm, "Don Guillett" <dguille...@austin.rr.com> wrote:
> Show sample data or
> * * * If desired, send your file to my address below. I will only look if:
> * * * 1. You send a copy of this message on an inserted sheet
> * * * 2. You give me the newsgroup and the subject line
> * * * 3. You send a clear explanation of what you want
> * * * 4. You send before/after examples and expected results.
>
> --
> Don Guillett
> Microsoft MVP Excel
> SalesAid Software
> dguille...@austin.rr.com"srosetti" <thromb...@gmail.com> wrote in message
>
> news:2407a256-2547-4cab-9585-(E-Mail Removed)...
>
> >I have 2 column's that I wish to remove certain data from. *The cells
> > have various lengths in data, but each column starts and ends with a
> > certain char I want to remove.

>
> > For instance in Column B the cell data starts and ends with a " sign.
> > I need these removed.

>
> > In Column C the cells all start with a " sign and end with a ");
> > These symbols need to be removed from the respective column data. *I
> > have over 50,000 entries so..this is why I'm looking to automate it
> > with either a macro, vba, direct excel solution etc.

>
> > Any Ideas on the problem at hand?

>
> > Thanks

>
>


Because of the nature of the file.. I will only be able to send some
sample data.
I'll give some various examples of different types of data.



Sample Data Expected Data
Column B C Column B
C
"AGR30P" "01683"); AGR30P
01683
"AM30LP-P" "03340"); AM30LP-P
03340
"Regency" "10602-70301"); Regency
10602-70301
"3500 series" "11002"); 3500 series
11002
"4040-NAT" "10602-71202"); 4040-NAT
10602-71202
"6000-S-41001" "11002"); 6000-S-41001
11002
"GF540-286-SB" "39400"); GF540-286-SB
39400
"BGA48-BQARL" "03360"); BGA48-BQARL
03360


Ok, You should get the picture of what i'm doing from the sample
data. I picked random entries throughout the spreadsheet so it was a
fair sampling. I have to do this over 50,000 times so...

There is exactly this number of rows down.. 53,077 entries or rows of
data. They all basically look like this in Column B and C.

Hope this helps you peeps with seeing what I'm asking..


Thank You










 
Reply With Quote
 
srosetti
Guest
Posts: n/a
 
      13th Nov 2009
On Nov 12, 5:32*pm, srosetti <thromb...@gmail.com> wrote:
> On Nov 12, 5:08*pm, "Don Guillett" <dguille...@austin.rr.com> wrote:
>
>
>
> > Show sample data or
> > * * * If desired, send your file to my address below. I will onlylook if:
> > * * * 1. You send a copy of this message on an inserted sheet
> > * * * 2. You give me the newsgroup and the subject line
> > * * * 3. You send a clear explanation of what you want
> > * * * 4. You send before/after examples and expected results.

>
> > --
> > Don Guillett
> > Microsoft MVP Excel
> > SalesAid Software
> > dguille...@austin.rr.com"srosetti" <thromb...@gmail.com> wrote in message

>
> >news:2407a256-2547-4cab-9585-(E-Mail Removed)....

>
> > >I have 2 column's that I wish to remove certain data from. *The cells
> > > have various lengths in data, but each column starts and ends with a
> > > certain char I want to remove.

>
> > > For instance in Column B the cell data starts and ends with a " sign.
> > > I need these removed.

>
> > > In Column C the cells all start with a " sign and end with a ");
> > > These symbols need to be removed from the respective column data. *I
> > > have over 50,000 entries so..this is why I'm looking to automate it
> > > with either a macro, vba, direct excel solution etc.

>
> > > Any Ideas on the problem at hand?

>
> > > Thanks

>
> Because of the nature of the file.. *I will only be able to send some
> sample data.
> I'll give some various examples of different types of data.
>
> * * * * *Sample Data * * * * * * * * * * * * * * *Expected Data
> Column * *B * * * * * * C * * * * * * * **Column * B
> C
> * * * *"AGR30P" * * * *"01683"); * * * * * * * * *AGR30P
> 01683
> * * * *"AM30LP-P" * * *"03340"); * * * * * * * * *AM30LP-P
> 03340
> * * * *"Regency" * * * "10602-70301"); * * * * * *Regency
> 10602-70301
> * * * *"3500 series" * "11002"); * * * * * * * * *3500 series
> 11002
> * * * *"4040-NAT" * * *"10602-71202"); * * * * * *4040-NAT
> 10602-71202
> * * * *"6000-S-41001" *"11002"); * * * * * * * * *6000-S-41001
> 11002
> * * * *"GF540-286-SB" *"39400"); * * * * * * * * *GF540-286-SB
> 39400
> * * * *"BGA48-BQARL" * "03360"); * * * * * * * * *BGA48-BQARL
> 03360
>
> Ok, You should get the picture of what i'm doing from the sample
> data. *I picked random entries throughout the spreadsheet so it was a
> fair sampling. *I have to do this over 50,000 times so...
>
> There is exactly this number of rows down.. 53,077 entries or rows of
> data. *They all basically look like this in Column B and C.
>
> Hope this helps you peeps with seeing what I'm asking..
>
> Thank You


That data didn't look so well.. Hope this helps

Sample Data Expected Data
B C Column B Column C
"AGR30P" "01683"); AGR30P 01683
"AM30LP-P" "03340"); AM30LP-P 03340
"Regency" "10602-70301"); Regency 10602-70301
"3500 series" "11002"); 3500 series 11002
"4040-NAT" "10602-71202"); 4040-NAT 10602-71202
"6000-S-41001" "11002"); 6000-S-41001 11002
"GF540-286-SB" "39400"); GF540-286-SB 39400
"BGA48-BQARL" "03360"); BGA48-BQARL 03360


Hope this looks better than previous post. One important thing to note
is....
In Column C it is perfectly ok if the zeroes in the beginning of the
whole numbers
drop off because excel decides to turn 01683 into 1683. That's fine
if it does.


Thanks again
 
Reply With Quote
 
srosetti
Guest
Posts: n/a
 
      13th Nov 2009
On Nov 12, 5:43*pm, srosetti <thromb...@gmail.com> wrote:
> On Nov 12, 5:32*pm, srosetti <thromb...@gmail.com> wrote:
>
>
>
> > On Nov 12, 5:08*pm, "Don Guillett" <dguille...@austin.rr.com> wrote:

>
> > > Show sample data or
> > > * * * If desired, send your file to my address below. I will only look if:
> > > * * * 1. You send a copy of this message on an inserted sheet
> > > * * * 2. You give me the newsgroup and the subject line
> > > * * * 3. You send a clear explanation of what you want
> > > * * * 4. You send before/after examples and expected results.

>
> > > --
> > > Don Guillett
> > > Microsoft MVP Excel
> > > SalesAid Software
> > > dguille...@austin.rr.com"srosetti" <thromb...@gmail.com> wrote in message

>
> > >news:2407a256-2547-4cab-9585-(E-Mail Removed)....

>
> > > >I have 2 column's that I wish to remove certain data from. *The cells
> > > > have various lengths in data, but each column starts and ends with a
> > > > certain char I want to remove.

>
> > > > For instance in Column B the cell data starts and ends with a " sign.
> > > > I need these removed.

>
> > > > In Column C the cells all start with a " sign and end with a ");
> > > > These symbols need to be removed from the respective column data. *I
> > > > have over 50,000 entries so..this is why I'm looking to automate it
> > > > with either a macro, vba, direct excel solution etc.

>
> > > > Any Ideas on the problem at hand?

>
> > > > Thanks

>
> > Because of the nature of the file.. *I will only be able to send some
> > sample data.
> > I'll give some various examples of different types of data.

>
> > * * * * *Sample Data * * * * * * * * * * * * * * *Expected Data
> > Column * *B * * * * * * C * * * * * * * * *Column * B
> > C
> > * * * *"AGR30P" * * * *"01683"); * * * * * * * * *AGR30P
> > 01683
> > * * * *"AM30LP-P" * * *"03340"); * * * * * * * * *AM30LP-P
> > 03340
> > * * * *"Regency" * * * "10602-70301"); * * * * * *Regency
> > 10602-70301
> > * * * *"3500 series" * "11002"); * * * * * * * * *3500 series
> > 11002
> > * * * *"4040-NAT" * * *"10602-71202"); * * * * * *4040-NAT
> > 10602-71202
> > * * * *"6000-S-41001" *"11002"); * * * * * * * * *6000-S-41001
> > 11002
> > * * * *"GF540-286-SB" *"39400"); * * * * * * * * *GF540-286-SB
> > 39400
> > * * * *"BGA48-BQARL" * "03360"); * * * * * * * * *BGA48-BQARL
> > 03360

>
> > Ok, You should get the picture of what i'm doing from the sample
> > data. *I picked random entries throughout the spreadsheet so it was a
> > fair sampling. *I have to do this over 50,000 times so...

>
> > There is exactly this number of rows down.. 53,077 entries or rows of
> > data. *They all basically look like this in Column B and C.

>
> > Hope this helps you peeps with seeing what I'm asking..

>
> > Thank You

>
> That data didn't look so well.. *Hope this helps
>
> Sample Data * * * * * * * * * * * * * * *Expected Data
> * * B * * * * * * * *C * * * * * * * Column * B * * * *Column C
> * *"AGR30P" * * * "01683"); * * * * * * * *AGR30P * * * 01683
> * *"AM30LP-P" * * "03340"); * * * * * * * *AM30LP-P * * 03340
> * *"Regency" * * *"10602-70301"); * * * * *Regency * * *10602-70301
> * *"3500 series" *"11002"); * * * * * * * *3500 series *11002
> * *"4040-NAT" * * "10602-71202"); * * * * *4040-NAT ** 10602-71202
> * *"6000-S-41001" "11002"); * * * * * * * *6000-S-41001 11002
> * *"GF540-286-SB" "39400"); * * * * * * * *GF540-286-SB 39400
> * *"BGA48-BQARL" *"03360"); * * * * * * * *BGA48-BQARL *03360
>
> Hope this looks better than previous post. One important thing to note
> is....
> In Column C it is perfectly ok if the zeroes in the beginning of the
> whole numbers
> drop off because excel decides to turn 01683 into 1683. *That's fine
> if it does.
>
> Thanks again


Tried the above formulas.. They worked great. Just had to edit the +
or - values for the two different columns, but it worked great..


Thanks :-)
 
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
How do I remove the last 4 characters within a cell Problem poser Microsoft Excel Misc 4 17th Jan 2009 12:35 AM
Remove Characters from a cell =?Utf-8?B?S2lt?= Microsoft Excel Worksheet Functions 8 1st Jun 2006 05:21 PM
Excel automation - need more than 255 characters in a cell Bill Murphy Microsoft Access Queries 4 7th Nov 2005 11:51 PM
Excel automation - need more than 255 characters in a cell Bill Murphy Microsoft Access VBA Modules 4 7th Nov 2005 11:51 PM
remove last three characters of cell =?Utf-8?B?bWlyYQ==?= Microsoft Excel Misc 8 28th Jul 2005 12:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:46 PM.