Dynamic Urserform

  • When the excel user clicks on the shape with a country name a userform will popup and the excel user can choose 2 buttons to change the shape color and the the string; However, this same code works fine in another workbook, but for this workbook I am getting variable not defined and error 1004 (application-defined or object-defined).

    Maybe someone can tell why this code is not working for this workbook??

    The first code is to change the shape color for green and add KYC in front of the country name.

    the second code is to add numbers in front of the country name and to change the shape color.


  • I am sharing the correct file.

  • Whilst you have declared these as public at the top of Module "Test"

    Code
    1. Public country_name As String
    2. Public shape_name As String

    You have also declared them again within some of the procedures. Make sure you remove the declarations from those procedures.

  • Whilst you have declared these as public at the top of Module "Test"

    Code
    1. Public country_name As String
    2. Public shape_name As String

    You have also declared them again within some of the procedures. Make sure you remove the declarations from those procedures.

    Fuff13, you are totally right.


    Thank you so much.

    :)

  • There is no sub named CallCountries in the workbook.


    Also,