I have a button to update a powerquery on Sheet 2 from another workbook. the number of rows of data will vary.
Now i want to include VB script on the button to update data on Sheet1 based off the data imported.
What I am trying to accomplish.
if Sheet2 column A has an entry that MATCHES Sheet1 column I (a calculated value if that matters)
use the corresponding data in sheet 2 column B to change the data in Sheet1 Column F
if Sheet2 column B = 5 change Sheet1 Column F to "Y"
if Sheet2 column B = 30 change Sheet1 Column F to "NONE"
if Sheet2 column B = (any other number) change Sheet1 Column F to "N"
Incidentally, i don't want any of the data changing if the Sheet2 column B does not match Sheet 1 Column F
Sample Data Sheet 1
<colgroup><col><col></colgroup><tbody>
</tbody>
Sheet 2 Sample Data
<colgroup><col><col></colgroup><tbody>
</tbody>
Sheet 1 desired result
<colgroup><col><col></colgroup><tbody>
</tbody>
I know the logic just cannot figure out the best way to code it. Any assistance is appreciated.
Now i want to include VB script on the button to update data on Sheet1 based off the data imported.
What I am trying to accomplish.
if Sheet2 column A has an entry that MATCHES Sheet1 column I (a calculated value if that matters)
use the corresponding data in sheet 2 column B to change the data in Sheet1 Column F
if Sheet2 column B = 5 change Sheet1 Column F to "Y"
if Sheet2 column B = 30 change Sheet1 Column F to "NONE"
if Sheet2 column B = (any other number) change Sheet1 Column F to "N"
Incidentally, i don't want any of the data changing if the Sheet2 column B does not match Sheet 1 Column F
Sample Data Sheet 1
<colgroup><col><col></colgroup><tbody> </tbody> |
<colgroup><col><col></colgroup><tbody>
</tbody>
Sheet 2 Sample Data
Column A | Column B |
Test Data 1 | 5 |
Test Data 3 | 30 |
Test Data 4 | 5 |
Test Data 6 | 30 |
Test Data 7 | 10 |
Test Data 9 | 5 |
<colgroup><col><col></colgroup><tbody>
</tbody>
Sheet 1 desired result
Column F | Column I (calculated resulting value) |
Y | Test Data 1 |
Y | Test Data 2 |
NONE | Test Data 3 |
Y | Test Data 4 |
N | Test Data 5 |
NONE | Test Data 6 |
N | Test Data 7 |
Y | Test Data 8 |
Y | Test Data 9 |
<colgroup><col><col></colgroup><tbody>
</tbody>
I know the logic just cannot figure out the best way to code it. Any assistance is appreciated.