Hello,
This is my first post so I am hoping I can get some help.
I need to write a macro that will search through a huge dataset in column A (may be 65000 rows) and for each time a certain value appears search up to another value and down to another value and copy that range.
Example: Assuming the below is column A
B
C
A
B
C *
1
2 <====
3
D
E *
F
E
D
C +
1
2 <====
E +
For each time "2" appears i need it to search for the nearest "C" above it (Marked with a *in first section and a + in second section) and the nearest "E" below it (also * and +) and copy that range to a new column. all values will repeat multiple times throughout the sheet so it has to copy the "E" and "C" nearest to the "2". There is also a varying number of rows between "C" and "E".
So based on the example above the answers I would like to get in column B are
C
1
2
3
D
E
and
C
1
2
E
Appreciate any help
Bookmarks