ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   unable to protect cells in macro sheet b/c runtime error 1004 (https://www.excelbanter.com/excel-worksheet-functions/180804-unable-protect-cells-macro-sheet-b-c-runtime-error-1004-a.html)

rldjda

unable to protect cells in macro sheet b/c runtime error 1004
 
I inherited a spreadsheet that consists of 2 sheets. Sheet 1 has a macro
that sorts data from sheet 2. This is how it works:

I enter "automotive" into Sheet 1 A2.
Then I press Ctrl A.
This command automatcally enters data into column B ( data from Sheet 2 that
is associated with "automotive" in Sheet 2.

I want to protect the entire Sheet 1 to protect the macros EXCEPT for A2. I
am able to protect the sheet except for A2 (so people could enter data such
as "automotive), but when I do the Ctrl A command, I get an error saying,

"Run-time error 1004: The cell or chart you are trying to change is
protected and therefore read only."

How can I protect A2 in Sheet 1 without affecting the macros?


Tom Hutchins

unable to protect cells in macro sheet b/c runtime error 1004
 
One way...

Have your macro (Ctrl-A ) unprotect the sheet, update column B, then
re-protect the sheet.

Hope this helps,

Hutch

"rldjda" wrote:

I inherited a spreadsheet that consists of 2 sheets. Sheet 1 has a macro
that sorts data from sheet 2. This is how it works:

I enter "automotive" into Sheet 1 A2.
Then I press Ctrl A.
This command automatcally enters data into column B ( data from Sheet 2 that
is associated with "automotive" in Sheet 2.

I want to protect the entire Sheet 1 to protect the macros EXCEPT for A2. I
am able to protect the sheet except for A2 (so people could enter data such
as "automotive), but when I do the Ctrl A command, I get an error saying,

"Run-time error 1004: The cell or chart you are trying to change is
protected and therefore read only."

How can I protect A2 in Sheet 1 without affecting the macros?



All times are GMT +1. The time now is 06:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com