event procedure

D

Dave

Hi,
I am using the following in a Worksheet, to prevent the user from using the
fill handle on that particular sheet:

Private Sub Worksheet_Activate()
Application.CellDragAndDrop = False
End Sub

Private Sub Worksheet_Deactivate()
Application.CellDragAndDrop = True
End Sub

However, if the workbook is saved with this sheet active, closed, then
opened, the macro doesn't fire. How can I prevent this from occurring?

Regards - Dave.
 
G

Gary''s Student

Don't let the user save the file with that special worksheet active.

Use the Workbook BeforeSave event to move off the sheet (to an alternative
sheet) prior to saving. When the file is re-opened, it will open with the
alternative sheet active. The user will have to select the special sheet and
the worksheet activate event code will trigger.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top