![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Location: South UK
Posts: 344
|
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 |
|
Board Regular
Join Date: Feb 2002
Location: Perth Australia
Posts: 1,567
|
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 |
|
Board Regular
Join Date: Feb 2002
Location: South UK
Posts: 344
|
Cheers Derek
That works a treat Many thanks |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|