Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find Results in excel copy the rows to another sheet

Tags:

excel

vba

I need some help copying data from one excel worksheet to another. For example:

Sample Data

__A__B___C

1 aaa bbb ddd

2 bbb ccc eee

3 ccc fff rrr

4 ccc fff ttt

5 ddd eee ggg

6 aaa ddd eee

7 bbb fff hhh

8 eee eee eee

So for the above records if I do a 'CTRL + F' and search to find All 'eee' the results will show 6 instances in C2, B5, C6, A8, B8, C8

Now I want to copy the whole of rows 2,5,6 and 8 to another worksheet.

like image 957
amateur Avatar asked Dec 26 '22 09:12

amateur


1 Answers

This worked for me... a simple solution:

  1. Select/highlight the data you want to search
  2. Press ctrl +h for Replace
  3. Enter the string you want to find in "Find What".
  4. Select "Replace with" Format, then Format > Fill and choose a background fill, doesn't matter what color. Then click [Replace All].
  5. Then choose on the Excel menu > Data > Sort on "Cell Color", Order (the color you chose from step 4 above) and then "On Top" or "On Bottom" - whatever you want, click [Ok].

Now all the data you wanted is all in one block of rows. Copy and paste to another worksheet as required.

like image 63
MarkAust Avatar answered Jan 28 '23 03:01

MarkAust