Hi All,
I have an extremely difficult issue that I am trying to solve by using a Macro, but I'm not sure if this is beyond Macro capabilities!
Currently, I have a macro for the below data, if Column B = 1 or 4 then replace data in Column C with Column D - then delete all of column D. This works fine.
[TABLE="width: 256"]
<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl65, width: 64"]A[/TD]
[TD="class: xl65, width: 64"]B[/TD]
[TD="class: xl65, width: 64"]C[/TD]
[TD="class: xl65, width: 64"]D[/TD]
[/TR]
[TR]
[TD="class: xl65"]709[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]24[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]709[/TD]
[TD="class: xl65"]4[/TD]
[TD="class: xl65"]24[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]709[/TD]
[TD="class: xl65"]20[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]709[/TD]
[TD="class: xl65"]9[/TD]
[TD="class: xl65"]12[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]711[/TD]
[TD="class: xl65"]20[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]711[/TD]
[TD="class: xl65"]9[/TD]
[TD="class: xl65"]36[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]712[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]36[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]712[/TD]
[TD="class: xl65"]4[/TD]
[TD="class: xl65"]36[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]712[/TD]
[TD="class: xl65"]20[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]712[/TD]
[TD="class: xl65"]9[/TD]
[TD="class: xl65"]12[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
</tbody>[/TABLE]
However, now what I am trying to do brings in an IF statement also based on Column A, in which is a unique ID tied to a person.
So, on a per person basis (ID in column A), after the macro I stated above has run, would deduct the value from column C, where the ID = 9 in Column B FROM the values in Column C where the ID = 1 or 4 in Column B
To use Column A ID 709 as an example, this is how the output should like once complete:
[TABLE="width: 256"]
<tbody>[TR]
[TD="class: xl65, width: 64"]A[/TD]
[TD="class: xl65, width: 64"]B[/TD]
[TD="class: xl65, width: 64"]C[/TD]
[TD="class: xl65, width: 64"][/TD]
[/TR]
[TR]
[TD="class: xl65"]709[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]30[/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"]709[/TD]
[TD="class: xl65"]4[/TD]
[TD="class: xl65"]30[/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"]709[/TD]
[TD="class: xl65"]20[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"]709[/TD]
[TD="class: xl65"]9[/TD]
[TD="class: xl65"]12[/TD]
[TD="class: xl65"][/TD]
[/TR]
</tbody>[/TABLE]
And in the Example of person 711 above, who has no 1 or 4 ID in Column B associated, no deductions would take place for them (since the deducted ID's are not present for that person) and it would look exactly as it does above so no changes necessary.
Hopefully some genius out there can help me figure this one out I've
been at it hours but it's far too confusing!
I have an extremely difficult issue that I am trying to solve by using a Macro, but I'm not sure if this is beyond Macro capabilities!
Currently, I have a macro for the below data, if Column B = 1 or 4 then replace data in Column C with Column D - then delete all of column D. This works fine.
[TABLE="width: 256"]
<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl65, width: 64"]A[/TD]
[TD="class: xl65, width: 64"]B[/TD]
[TD="class: xl65, width: 64"]C[/TD]
[TD="class: xl65, width: 64"]D[/TD]
[/TR]
[TR]
[TD="class: xl65"]709[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]24[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]709[/TD]
[TD="class: xl65"]4[/TD]
[TD="class: xl65"]24[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]709[/TD]
[TD="class: xl65"]20[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]709[/TD]
[TD="class: xl65"]9[/TD]
[TD="class: xl65"]12[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]711[/TD]
[TD="class: xl65"]20[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]711[/TD]
[TD="class: xl65"]9[/TD]
[TD="class: xl65"]36[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]712[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]36[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]712[/TD]
[TD="class: xl65"]4[/TD]
[TD="class: xl65"]36[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]712[/TD]
[TD="class: xl65"]20[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
[TR]
[TD="class: xl65"]712[/TD]
[TD="class: xl65"]9[/TD]
[TD="class: xl65"]12[/TD]
[TD="class: xl65"]42[/TD]
[/TR]
</tbody>[/TABLE]
However, now what I am trying to do brings in an IF statement also based on Column A, in which is a unique ID tied to a person.
So, on a per person basis (ID in column A), after the macro I stated above has run, would deduct the value from column C, where the ID = 9 in Column B FROM the values in Column C where the ID = 1 or 4 in Column B
To use Column A ID 709 as an example, this is how the output should like once complete:
[TABLE="width: 256"]
<tbody>[TR]
[TD="class: xl65, width: 64"]A[/TD]
[TD="class: xl65, width: 64"]B[/TD]
[TD="class: xl65, width: 64"]C[/TD]
[TD="class: xl65, width: 64"][/TD]
[/TR]
[TR]
[TD="class: xl65"]709[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]30[/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"]709[/TD]
[TD="class: xl65"]4[/TD]
[TD="class: xl65"]30[/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"]709[/TD]
[TD="class: xl65"]20[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"]709[/TD]
[TD="class: xl65"]9[/TD]
[TD="class: xl65"]12[/TD]
[TD="class: xl65"][/TD]
[/TR]
</tbody>[/TABLE]
And in the Example of person 711 above, who has no 1 or 4 ID in Column B associated, no deductions would take place for them (since the deducted ID's are not present for that person) and it would look exactly as it does above so no changes necessary.
Hopefully some genius out there can help me figure this one out I've
