Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unprotect worksheet when mouse moves 1

Status
Not open for further replies.

HomeGrowth

Technical User
Aug 19, 2004
76
US
I wonder whether Excel has an event when the mouse moves to the side of the worksheet, it unprotects the worksheet to allow user adjust the row height, and reprotect the worksheet when the mouse moves back to the worksheet.

In other words, I have a protected worksheet, but still want to give the user the freedom of adjusting row height. Any suggestions? Thanks
 


I need an event that triggers every time the mouse moves to the side of the worksheet, so I can code

(1) unprotect the worksheet to allow user adjust the row height.

and then when the mouse goes back to the worksheet, it protects the worksheet again.

Possible?
 



What have you tried so far?

There is no mouse events for the sheet in VBA.

You could, however, use the Selection Change event for selection in cells in row 1, for instance to trigger the macro.

Skip,

[glasses] [red][/red]
[tongue]
 
Have a look at the AllowFormattingRows named parameter of the Worksheet.Protect method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
AllowFormattingRows works perfectly. Thank you all for the suggestions, especially PHV for a second effort.

now my code looks like this to keep the worksheet protected, but user can still adjust the row height.

ActiveSheet.Protect AllowFormattingRows:=True
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top