Forum Discussion
dwight10000
May 02, 2024Copper Contributor
filtering OUT positions loop (Vba)
i assume i would need multiple loops but Im a newb lol highlighted are the pairs of offsetting positions (the different colors indicate the offsetting pairs) how do i know they're offs...
OliverScheurich
May 02, 2024Gold Contributor
If i correctly understand there are offsetting positions which can be identified by an existing TAG code in column H. Each TAG code groups 2 or more positions which balance each other. These positions should be cleared from sheet1 and entered to sheet2. Then there are positions without a TAG code in column H which are still outstanding. These outstanding positions should remain in sheet1. For this scenario you can check if the code in the attached file does exactly what you are looking for.
dwight10000
May 02, 2024Copper Contributor
correct, given that the matching TAG has the opposite signs of numbers in either column A or C
AND
one has blank in column E,the other has "C" in the same column (ie column E)
AND
one has blank in column E,the other has "C" in the same column (ie column E)
- OliverScheurichMay 07, 2024Gold Contributor
The code in the attached file copies the pairs of offsetting positions with matching TAG code to sheet2 if there are opposite signs in column A and if there is either "C" or "" in column E. These positions are removed from sheet1.