+ Reply to Thread
Results 1 to 4 of 4

VBA to disable keystrokes?

  1. #1
    Mark
    Guest

    VBA to disable keystrokes?

    I have customised a file which removes toolbars, menus etc and some of the
    sheets (accessed by macros linked to buttons) I want to keep private.

    However, I have realised that the sheets can be accessed by using ctrl+page
    up or page down. Is there a macro I can use to disable these keys?

    Another way would be to hide the sheets I don't want people to access but I
    cant unhide them and rehide them using a macro for some reason
    (worksheets.visible) when I need to access them.

    Any help would be appreciated.

    Mark


  2. #2
    Norman Jones
    Guest

    Re: VBA to disable keystrokes?

    Hi Mark,

    > Another way would be to hide the sheets I don't want people to access but
    > I
    > cant unhide them and rehide them using a macro for some reason
    > (worksheets.visible) when I need to access them.


    This should be feasible.

    Post the problematic code.


    ---
    Regards,
    Norman



    "Mark" <[email protected]> wrote in message
    news:%[email protected]...
    >I have customised a file which removes toolbars, menus etc and some of the
    > sheets (accessed by macros linked to buttons) I want to keep private.
    >
    > However, I have realised that the sheets can be accessed by using
    > ctrl+page
    > up or page down. Is there a macro I can use to disable these keys?
    >
    > Another way would be to hide the sheets I don't want people to access but
    > I
    > cant unhide them and rehide them using a macro for some reason
    > (worksheets.visible) when I need to access them.
    >
    > Any help would be appreciated.
    >
    > Mark
    >




  3. #3
    Ardus Petus
    Guest

    Re: VBA to disable keystrokes?

    To disable/reenable Ctrl+PGUP & PGDN:

    '--------------------------------
    Sub NoTab()
    With Application
    .OnKey "^{PGUP}", ""
    .OnKey "^{PGDN}", ""
    End With
    End Sub

    Sub ResetTab()
    With Application
    .OnKey "^{PGUP}"
    .OnKey "^{PGDN}"
    End With
    End Sub
    '--------------------------------

    HTH
    --
    AP

    "Mark" <[email protected]> a écrit dans le message de news:
    %[email protected]...
    >I have customised a file which removes toolbars, menus etc and some of the
    > sheets (accessed by macros linked to buttons) I want to keep private.
    >
    > However, I have realised that the sheets can be accessed by using
    > ctrl+page
    > up or page down. Is there a macro I can use to disable these keys?
    >
    > Another way would be to hide the sheets I don't want people to access but
    > I
    > cant unhide them and rehide them using a macro for some reason
    > (worksheets.visible) when I need to access them.
    >
    > Any help would be appreciated.
    >
    > Mark
    >




  4. #4
    Mark
    Guest

    Re: VBA to disable keystrokes?

    Ardus Petus wrote:
    >> To disable/reenable Ctrl+PGUP & PGDN:
    >>
    >> '--------------------------------
    >> Sub NoTab()
    >> With Application
    >> .OnKey "^{PGUP}", ""
    >> .OnKey "^{PGDN}", ""
    >> End With
    >> End Sub
    >>
    >> Sub ResetTab()
    >> With Application
    >> .OnKey "^{PGUP}"
    >> .OnKey "^{PGDN}"
    >> End With
    >> End Sub
    >> '--------------------------------
    >>
    >> HTH


    Thanks. I'll add it to auto open / auto close.

    Mark


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1