I am not that much familiar in VBA code. I am looking to implement two scenarios using VBA code in excel.
Scenario 1: If the value in the "C" column contains specific text, then replace the corresponding values in the "A" column as below If the value in C contains "abc" then A= "abc". If the value in C contains "gec" then A= "GEC".
It should loop from the second row to last non-empty row
A | B | C |
---|---|---|
Two | abc-def | |
Thr | gec-vdg | |
Thr | abc-ghi |
Expected Result:
A | B | C |
---|---|---|
abc | Two | abc-def |
gec | Thr | gec-vdg |
abc | Thr | abc-ghi |
Scenario 2: If the value in the "B" column is "A", then replace all the "A" value in the B column as "Active". If the value in the "B" column is I", then replace all the I value in the B column as inactive.
It should loop from the second row to last non-empty row
A | B | C |
---|---|---|
abc | A | abc-def |
gec | I | gec-vdg |
abc | A | abc-ghi |
Expected Result:
A | B | C |
---|---|---|
abc | Active | abc-def |
gec | Inactive | gec-vdg |
abc | Active | abc-ghi |
I know that it is possible by using excel formulas. Wondering, how it can be implemented using vba code in excel.