Relatively new to macros and I'm starting to venture past the recorder. I've been knocking my head against the wall on this...
I would like to search a short range in one column (B1:B50) for two of 5 names.
Two, and only two of the five names will always appear in the range. And, each name will only appear once. However, the location of the two names within the range will vary from one day to the next.
When the first name is found, I would like to cut the row containing the name and the two rows immediately below it and insert them at row 15 (B15:B17).
Resuming the search at B18, when the second name is found, I would like to cut the row+2 and insert them at row 25 (B25:B27).
Example. Names: John, Joe, Jack, Jill, Jane. 'Jill' is located in cell B27. 'John' is located in cell B33.
What VBA code would, 1) search for the names in range B1:B50, 2) identify the row when a name is found 3) activate (for the 'Jill/John' example) row 27:29 and 4) insert them at row 15 (new position, row 15:17). And, then repeat the cycle for 'John'?
Any help would be greatly appreciated.
Bookmarks