Hi
Wonder can anyone help.
I am trying to use a Loop and and IF and another Loop in a macro with vba.
Sheet1: Sheet_Source
Sheet2: Sheet_Display
I have unique ID in Sheet_Source and is sorted smallest to largest and also there is some ID's duplicated so I want to:
STEP 1-
In Sheet_Display Loop until next cell is blank in Column A Sheet_Source and then if there is a value in Sheet_Source Column A (ID)
STEP2-
Then In Sheet_Display Column A (ID) I want to compare the value above it is not equal to it then if it is true in that row
STEP4-
copy that ID into Column A in Sheet_Display and copy cells D from Sheet_Source to Sheet_Display Column C & F-AC in Sheet_Source to Sheet_Display E-AB
STEP3-
But if the ID is equal to the value above in Sheet_Display if there is duplicated IDs (which I have sorted together already in a macro) then loop through however many are there take the highest value from Column D of that group and do step 4.
So I will have one ID per row and it is the highest amount of and no duplicated IDs.
Can anyone help or give pointers if this is the correct approach,
Thanks.
Wonder can anyone help.
I am trying to use a Loop and and IF and another Loop in a macro with vba.
Sheet1: Sheet_Source
Sheet2: Sheet_Display
I have unique ID in Sheet_Source and is sorted smallest to largest and also there is some ID's duplicated so I want to:
STEP 1-
In Sheet_Display Loop until next cell is blank in Column A Sheet_Source and then if there is a value in Sheet_Source Column A (ID)
STEP2-
Then In Sheet_Display Column A (ID) I want to compare the value above it is not equal to it then if it is true in that row
STEP4-
copy that ID into Column A in Sheet_Display and copy cells D from Sheet_Source to Sheet_Display Column C & F-AC in Sheet_Source to Sheet_Display E-AB
STEP3-
But if the ID is equal to the value above in Sheet_Display if there is duplicated IDs (which I have sorted together already in a macro) then loop through however many are there take the highest value from Column D of that group and do step 4.
So I will have one ID per row and it is the highest amount of and no duplicated IDs.
Can anyone help or give pointers if this is the correct approach,
Thanks.