Excel/Excel Copying

Advertisement


Question
Hi Mr. Heritage,
I have a huge list of data in an excel file, and throughout column A there are rows that have "RPO" in the line. Three characters after the "RPO" are very important and need to be COPIED to the same row, but column H. Is there a macro or formula I may use to solve this issue. I also need it to loop.

Thank you.

Answer
You can do this with a formula, which is probably the quickest way - various methods exist, this one is fairly simple

=IF(ISERROR(SEARCH("RPO",UPPER(A1))),"",MID(A1,SEARCH("RPO",UPPER(A1))+3,3))


NOTE that I've used ISERROR to handle lines with no RPO in them.  I'm used UPPER as search is case sensitive.  You said three characters after RPO - I took this as being the characters immediately following RPO.  My example works for row one and can be copied down - just amend reference to A1 to whichever row you actually want to start at.
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Aidan Heritage

Expertise

I have provided first hand support since `95 for Microsoft Office majoring in Word and Excel - support for all versions from 2 onwards. I'm based in the UK, so please allow for time differences when asking me questions from other parts of the world!

Experience

My background is in the insurance industry and call centre areas, but have been called upon to provide many varied solutions.

Education/Credentials
I'm educated to UK A level standard, but as I left school some 30 years ago that is rather irrelevent - university of life has provided more of a background!

©2016 About.com. All rights reserved.