Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

linnea13 asked in Computers & InternetSoftware · 1 decade ago

How do I prevent others from trying to run my Macro?

Others need to see and copy the data but they don't have access to the source data so they will end up deleting the data that everyone needs rather than updating it. Is there a way to set a password for just the macro?

1 Answer

Relevance
  • 1 decade ago
    Favorite Answer

    1.

    at the beginning of your macro you can write a validation

    const mypass as string = "mypass"

    sub XXXXXX()

    dim myvalidation as string

    myvalidation = inputbox("your pass please")

    if myvalidation = mypass then

    ---your macro----

    else

    exit sub

    end sub

    2.

    macro can be "locked for viewing" & password protected.

    (VBE, menu Tools> VBAProject > Properties)

Still have questions? Get your answers by asking now.