try this.
dont forget to password protect your vba Project and keep in mind that this also can be hacked by third party tools..

Sub vbax_54262_Password_Run_Macro()
    
    Dim vPass As Variant
    Dim sPass As String

    sPass = "RealPassword"
    vPass = Application.InputBox(Prompt:="Please enter password to proceed...", Title:="Password", Default:="Password")

    If vPass = False Then 'Cancel button pressed
        MsgBox "You pressed cancel. Quitting macro....", vbOKOnly, "Cancelled"
        Exit Sub
    End If

    If vPass <> sPass Then  'Wrong password entered
        MsgBox "Please enter correct password. Quitting macro....", vbOKOnly, "Wrong password"
        Exit Sub
    End If

    'all code here when password is correct
    '
    '
    '

End Sub