Hi there,
I am trying to apply the logic below to a code in VBA. Please see the attached screenshot of the excel screen for an added visual. In essence, if the specific size qty in column C is greater than it's corresponding size qty in column F, I need the value of column F to be reflected in column C (overriding the previous qty in column C with the value from column F). This is because the qty in column C cannot exceed the qty in column F.
If the VBA makes a change to column C, I need to change the font of the cell within column C to red, to visually indicate to a user that it has been changed. The logic would start at cell E8 (size 6, 60 qty) and work it's way down the list until it has reached cell E24 (size 15, 73 qty)
I thought using Index Match would be a good way to compare the size quantities, while also using an If formula to identify whether or not the qty in column C is > the qty in column F. However, Index Match doesn't get me the location of the cell, in which I would feed into the If formula. I am able to eye ball it in this example but that isn't a successful long term strategy, or one that I can automate this process with. (I converted these formulas over to VBA, but again, I don't think this is the correct path I should be taking - so probably disregard the below pieces of code)
Would love to hear your thoughts
I am trying to apply the logic below to a code in VBA. Please see the attached screenshot of the excel screen for an added visual. In essence, if the specific size qty in column C is greater than it's corresponding size qty in column F, I need the value of column F to be reflected in column C (overriding the previous qty in column C with the value from column F). This is because the qty in column C cannot exceed the qty in column F.
If the VBA makes a change to column C, I need to change the font of the cell within column C to red, to visually indicate to a user that it has been changed. The logic would start at cell E8 (size 6, 60 qty) and work it's way down the list until it has reached cell E24 (size 15, 73 qty)
I thought using Index Match would be a good way to compare the size quantities, while also using an If formula to identify whether or not the qty in column C is > the qty in column F. However, Index Match doesn't get me the location of the cell, in which I would feed into the If formula. I am able to eye ball it in this example but that isn't a successful long term strategy, or one that I can automate this process with. (I converted these formulas over to VBA, but again, I don't think this is the correct path I should be taking - so probably disregard the below pieces of code)
VBA Code:
= "=INDEX(C:C,MATCH(E8,B:B,0))"
= "=IF(C13>F8,F8,C13)"
Would love to hear your thoughts