PDA

View Full Version : [SOLVED] Turning off alerts issue



nikki333
11-08-2019, 01:17 PM
Hi Folks

I'm tring to let the user select rows within a table and to give a feedback via cell color change. However, this is to happen on a locked worksheet.

Therefore, I've added an event procedure (double click) that unlocks the worksheet at the top of the procedure and lock it again before exiting the procedure.

This is all working as expected, but when the locking statement is carried out, a message box pops up, saying that my sheet is protected and blabla. But, actually, at that point the procedure did it's job; so it's only the annoying message I'd like to get rid off. I've tried "Application.DisplayAlerts = False", but that has no effect.

Any ideas?

Cheers

Artik
11-08-2019, 03:17 PM
Double clicking on a cell will edit it. If the sheet is protected, you get information about it and the cell will not be edited. So much theory. Now let's get to practice.
You've definitely used the Worksheet_BeforeDoubleClick event. As the name suggests, this event occurs immediately after double-clicking, but before editing the cell. In this state, you unlocked the sheet, changed something in it, and re-locked it. After completing the procedure, an attempt is made to edit this cell (I remind you of the first and second sentences of my speech).
If you want the double-click to work non-standard, you must disable standard operation. In a very simple way. In the mentioned event, at the end of the procedure add
Cancel = True You can put this line of code almost anywhere in the procedure.

Artik

nikki333
11-09-2019, 05:47 AM
Thank you very much Artik