You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .

When I protect a particular worksheet, it includes formulas on certain cells.
However, when I click a commandbutton the macros should run to change a particular cell to another value, even though a formula like "=Sum(K2+K3)" is laready on that cell.
This is not the case when Sheet Protection is on. Each time I click on the Commandbutton, it displays this "Sheet is protected".
How do I go about it to run the procedures attached to the commandbuttons in a protected sheet, as other cells are also required to be protected.
The answer given by Excel is to unprotect the worksheet, but this will lead to other cells that should be protected becoming unprotected again!
:(

Hi! Vemaju,
Sorry for the delay in thanking you.
I found out the same principle as yours earlier on and forgot to return to this forum on time.
I started off with codes to unprotect the sheet first , then ending it by protecting codes!
It's good to have someone like you assisting me, but I am not sure whether it's proper for me to ask farther as I am still on the "Commandbutton topic", or shall I post a new topic?