Excel VBA - Update Cells in Different Worksheet using Row and Column Number

  • Hi all,


    I need your help to create macro:


    "Sheet1" has data below:


    Tag CHECK
    Check No Number 3
    Countries
    Slovakia
    Poland
    Germany
    France
    United Kingdom
    Indonesia




    "Sheet2" has below data:


    Check No Number 1 Number 2 Number 3 Number 4 Number 5
    Countries
    Bulgaria
    Cyprus
    Finland
    France
    Germany
    Hungary
    Italy
    Luxembourg
    Netherlands
    Poland
    Portugal
    Romania
    Slovakia
    Spain
    United Kingdom


    I want to add Tag (in this case, "CHECK") to matching intersection cells in Sheet2.

    If there is no data in Sheet2, then I wan to add another Row at the end of the data. (In this case, Indonesia is not on Sheet2, I want to create new row for Indonesia).


    The desired outcome:



    Check NoNumber 1Number 2Number 3Number 4Number 5
    Countries
    Bulgaria
    Cyprus
    Finland
    France CHECK
    Germany CHECK
    Hungary
    Italy
    Luxembourg
    Netherlands
    Poland CHECK
    Portugal
    Romania
    Slovakia CHECK
    Spain
    United Kingdom CHECK
    IndonesiaCHECK



    The Countries will be changed every week, and Tag can also be changed.


    So, if I want to change the Tag to ALERT and I want to add this Tag to some countries (Italy, Poland, France and Spain) under Check Number 4;


    The desired outcome:




    Check NoNumber 1Number 2Number 3Number 4Number 5
    Countries
    Bulgaria
    Cyprus
    Finland
    France CHECK ALERT
    Germany CHECK
    Hungary
    Italy ALERT
    Luxembourg
    Netherlands
    Poland CHECK ALERT
    Portugal
    Romania
    Slovakia CHECK
    Spain ALERT
    United Kingdom CHECK
    IndonesiaCHECK



    Anyone can help me?


    Thank you!

  • Below is something I tried to do:


  • I've tried below as well..


  • Hello,


    If the objective is to adapt your macro to your current structure ...;)


    attached is your test file ...


    Hope this will help

    Files

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)