Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a spreadsheet with a cell which contains every app on a computer. I want a macro to extract a specific application from the list and delete the rest of the apps and simply display the application I want in the same or next cell.

For example the cell data looks like this:

"Microsoft Office Project Professional 2010 - 14.0.6029.1000"; "Security Update for Microsoft Office 2010 (KB2598039) 32-Bit Edition"; "Security Update for Microsoft Office 2010 (KB2553091)"; "Definition update for Microsoft Office 2010 (KB982726) 32-Bit Edition"; "Update for Microsoft Office 2010 (KB2553455) 32-Bit Edition"; "Update for Microsoft Office 2010 (KB2494150)"; "Update for Microsoft Office 2010 (KB2553181) 32-Bit Edition"; "Microsoft Project 2010 Service Pack 1 (SP1)";

I would like it to search the cell for any version of "Microsoft Office Project" then delete the rest of the cell text and display Microsoft Office Project Professional 2010 - 14.0.6029.1000.

I don't know where to begin as I've never created a macro. Any ideas how I can do this?

share|improve this question

Here's a formula solution. If the text is in A1, you can enter the following in B1:

=MID(A1,FIND("Microsoft Office Project",A1),FIND("""",A1,FIND("Microsoft Office Project",A1))-FIND("Microsoft Office Project",A1))
share|improve this answer
    
Thanks very much, that works well just need to tweak it a little. Much appreciated – Michael Jul 25 '12 at 3:20
    
How could I tweak he formula to respond with a 0 or something else if it doesnt find anything. It seems to bring down the result from the box above if nothing is found? – Michael Jul 25 '12 at 3:40
    
It should throw an error if nothing is found. Perhaps you missed an A1 in the formula when tweaking it? – Excellll Jul 25 '12 at 4:25

Here is another solution which displays "not found" if the search string could not be found:

=IF(ISNUMBER(FIND("Microsoft Office Project Professional",A1)),MID(A1,FIND("Microsoft Office Project Professional",A1),FIND("""",A1,FIND("Microsoft Office Project Professional",A1)+1)-FIND("Microsoft Office Project Professional",A1)),"not found")

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .