Link to home
Create AccountLog in
Avatar of tmonteit
tmonteitFlag for Afghanistan

asked on

Using Excel VBA to scrub data in cells

I have a very large Excel 2010 spreadsheet with several columns of fields that contain paragraphs of text.  There is so much text in some of these cells that they often unviewable in excel screen.  The text in these cells contains test results that are sometimes written, and sometimes computer generated.  There are about 600 rows of data so automation is desired to assist.

The text I need to scrub are in columns 'P', 'Q', and 'R' of the excel spreadsheet.  
Column 'S' is my 'Test Status' Column.  For every row, I want to look for several phrases in cells 'P', 'Q', and 'R' and then put a code cell 'S'.    For example, if I find the phrase "not complete" (in any case) in my source cells, I want to put "NP" in cell S.  If I find the phrase "completed" (without not in front of it), I want to put the code "COMP" in cell S.  "Strong correlation" becomes "SC", "Weak Correlation" becomes "WC".   If none of these are found then the cell will be blank.

I would like to run the code with a button.  What's the easiest / best way to accomplish this?  Any simple examples?
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
I'm glad I was able to help.

Marty - MVP 2009 to 2013