I have an excel sheet where there are a lot of columnst that have either Yes, No and Null Values. Going down the list there are companies and they may appear multiple times, however the columns may have different values. I want to loop through the repeat company's values and if they are yes, paste the value into the first appearance of the company's name. For example, Company A appears three times. I want to loop trought the 2nd and third time and if there is a value of yes, copy and paste it into the first time appearance in the same column. I paste a sample view below.
Before View
After VBA Code View
Before View
Code:
<table border="1"> <tr> <td>Company</td> <td>A</td> <td>A</td> <td>A</td> <td>B</td> </tr> <tr> <td>Value 1</td> <td>Yes</td> <td>No</td> <td>No</td> <td>Yes</td> </tr> <tr> <td>Value 2</td> <td>No</td> <td>Yes</td> <td>No</td> <td>Yes</td> </tr> <tr> <td>Value 3</td> <td>Yes</td> <td>No</td> <td>No</td> <td>Yes</td> </tr> </table>
After VBA Code View
Code:
<table border="1"> <tr> <td>Company</td> <td>A</td> <td>B</td> </tr> <tr> <td>Value 1</td> <td>Yes</td> <td>Yes</td> </tr> <tr> <td>Value 2</td> <td>Yes</td> <td>Yes</td> </tr> <tr> <td>Value 3</td> <td>Yes</td> <td>Yes</td> </tr> </table>
Comment