![]() |
![]() |
|
|||||||
| 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: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Good Morning Friends!
Can someone take a look at the following code and tell me how I can keep the protected sheet warning from popping up? The code in the event functions as it should and the values change as they should but the protection warning pops up after the event exits. Not a huge deal, but would like to know how to get rid of this msgbox. Thanks! Tom Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim CurrentCategory As String Dim RowCntr As Long Dim HoldSelectionRow As Long ActiveSheet.Unprotect Application.ScreenUpdating = False Application.EnableEvents = False 'Code Here Application.EnableEvents = True ActiveSheet.Protect End Sub [ This Message was edited by: TsTom on 2002-04-02 01:46 ] [ This Message was edited by: TsTom on 2002-04-02 01:51 ] [ This Message was edited by: TsTom on 2002-04-02 01:53 ] |
|
|
|
|
|
#2 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi Tom
Use the Cancel argument, and set it to True. I would say Excel is trying to go into Edit Mode after the code has run. Just put: Cancel=True as the first line. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|