Assign macro to whole page
Assign macro to whole page
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Assign macro to whole page

  1. #1
    Board Regular swaink's Avatar
    Join Date
    Feb 2002
    Location
    51.421818,-0.977139
    Posts
    432
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Hi Everyone

    One question is it possible to set up a worksheet, so that if a user clicks anywhere on the sheet it activates a macro.

    I'm looking to have a sheet the user can view only and print it off if they wish.

    Best regards

    Kevin

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Perth Australia
    Posts
    1,579
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Kevin

    Try something like this event macro

    Right click sheet tab, left click View Code and paste this code into the white area.
    Change "name of your macro" to the one you want to run (retain the quote marks)


    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Answer = InputBox("Do you want to print this page? Type YES OR NO")
    If Answer = "YES" Then Application.Run "name of your macro"
    End Sub

    Regards
    Derek

  3. #3
    Board Regular swaink's Avatar
    Join Date
    Feb 2002
    Location
    51.421818,-0.977139
    Posts
    432
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Cheers Derek

    That works a treat

    Many thanks

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com