Link to home
Start Free TrialLog in
Avatar of vegas86

asked on

Macro to search for text then copy and paste range to another sheet

I have a spreadsheet that I would like to create a macro for, I have searched the internet and can’t seem to find what I would like.

What I would like is for the macro to search column I on sheet 1 for the specific text string “your name goes here”
When it finds the text string I would like it to copy that row and then 19 rows under that so 20 all up, I want it to copy the entire row not just a range and then paste the results one after the other down the page on sheet 2.

Can this be done?
Avatar of Anne Troy
Anne Troy
Flag of United States of America image

I won't be able to program this myself, but the following answers will help the real coder(s):

--What row to begin pasting on sheet 2? First row, first blank row, or a specific row?
--Do you want to just copy it? Or move it?
--Do you need a dialog to ask you what the string will be each time? Or is it the same string each time? (i.e., is it always "your name goes here"?)
--You said "paste the results". Do you mean paste the data or are is there formulas and you want to paste the resulting values? can definitely be done.
Avatar of vegas86


thanks dreamboat, to answer your questions:

- It can start on the first row to being pasting on sheet 2
- Either or, which ever is easiest. Probably copy
-It will always be "your name goes here" it will not change
- I mean paste the results, there are formulas but I figured just pasting will paste both formulas and data.
Avatar of dlmille
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vegas86



This works perfectly!!

Thank you, Thank you, THANK YOU!!!

You have saved my day!