Good day Sir. I have macro problem. Let me explain. in Sheet1 Column A rows 1 to 10 there is a named range "LIST". Example Cat, Dog, Horse, Zebra, Goat etc. Then in Sheet2 in Column D rows 1 to 100 there are a lot of data with Cat, Dog, Horse, Zebra, Goat etc.

Here's the problem. I hope to run a macro that would 1st find the values in the LIST (Sheet1) example Cat to copy all the values in Sheet2 column D and then transfer is to Sheet 3 then save a new workbook entitled CAT. Then next here comes the looping part. The macro will run with the DOG in List (Sheet1) and find it in Sheet2 Column D and paste it in Sheet 3 then save a new workbook entitled DOG. Sheet 3 is just a reserved space for the operations it will be overwritten by the LIST.

I hope its clear can you please help me because its hard to do it manually if the LIST is about 100 values. With just a macro can it be done?

Thank you and more power!

I need more info
Q1: Is the macro asking for some input and you enter "Cat" and it does what you want with cat or do you want the macro to take each of the items in Sheet A1:A10 and loop for all 10 items?
Q2: The values in Sheet2 Col D are Cat, Dog, ... Horse, Dog, Dog,...Zebra, Cat... etc? What is it finding? All the items with Cat in it (then dog...)? Copy that to sheet3? So if sheet2 Col D has Cat 12 times, it will copy Cat 12 times to Sheet3? So Sheet3 Column A(?) would have A1:A12 all containing Cat?? Then Sheet3 is saved as a workbook named CAT.xlsx?? And all it contains is one sheet with A1:A12 containing Cat?

I'm thinking I'm misunderstanding exactly what you want!

And yes, a macro can do the job
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


All Answers

Answers by Expert:

Ask Experts


Bob Umlas


I`m a Microsoft Excel MVP (Most Valuable Professional) and have been since the inception of the program in 1995. I can answer every kind of Excel question except: API, Importing/exporting to other programs (powerpoint, word,...) Also check out my in-person training link at http://www.thumbtack.com/ny/new-york/excel-training/


Worked with MS Excel since version 0.99 (on the Mac!). Was contributing editor to Excellence Magazine, having written >300 articles. John Walkenbach said of me "I finally met someone who knows as much about Excel as I do."

Excellence, The Expert, Microsoft

BA in math, Hofstra University, 1965

Awards and Honors
Led sessions for the Convergence 2004-2006 seminar on Excel tips & tricks

©2016 About.com. All rights reserved.