How do I create code for the range DW63:EW116 that will record in each column the count of row(s) that letter “O” between each “H”. Always restart the count with the first “O” match after the “H”. Paste the result in the same cell as the match.
Partial Example:
If DW63:DW85 =, THEN THE UPDATE RESULT SHOULD BE
H,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,H
O,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1
O,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2
O,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3
H,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,H
H,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,H
O,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1
O,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2
H,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,H
O,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1
O,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2
O,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,3
O,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4
O,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,5
O,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,6
H,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,H
O,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1
O,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2
H,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,H
H,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,H
O,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1
O,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,2
H,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,H
Partial Example:
If DW63:DW85 =, THEN THE UPDATE RESULT SHOULD BE
H,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,H
O,,,,,,,,,,,,,,,,,,,,,,,,,,,,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