Search code examples
excelvba

I used ctrl+v for a macro, now i can't turn it back to the regular paste


I used the keyboard shortcut ctrl+v for a macro, now i deleted the file that has the macro and can't turn it back to the regular paste. When i use it, this is the error shown

enter image description here


Solution

    • Excel retains the shortcut settings even if you delete the host file (which has the VBA code).

    • Use below code to reset the setting.

    Microsoft documentation:

    Application.OnKey method (Excel)

    Sub ResetShortcut()
        Application.OnKey "^v"
    End Sub