Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protecting data rather than certain cells
Hello,
I locked certain cells on my worksheet, and then protected the worksheet. However, now I wish to sort the data, but keep the data that was in the protected cells protected. Since certain cells are locked and not data, when I perform a sort, only those same cells are protected, rather than the data being protected. Is there any way I can protect the data instead? Thanks for the help! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protecting data rather than certain cells
One way might be to change the background of the cells
containing the data I want locked (call it old data) to green. Then I enter my new data (that doesn't need to be protected)on white rows. Then I can sort the data, and close the spreadsheet. Every time the spreadsheet opens, I could have a macro that does the following: - Checks if the worksheet is protected, and if so unprotects it - for all cells, if background is green, lock, else unlock - reprotect the sheet. Can anyone see a problem with this? Also, can anyone help me code the macro or provide me some resources to do so? Thanks. -----Original Message----- Hello, I locked certain cells on my worksheet, and then protected the worksheet. However, now I wish to sort the data, but keep the data that was in the protected cells protected. Since certain cells are locked and not data, when I perform a sort, only those same cells are protected, rather than the data being protected. Is there any way I can protect the data instead? Thanks for the help! . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protecting data rather than certain cells
Dim cell as Range
ActiveSheet.Unprotect Cells.Locked = False for each cell in Range("A1").CurrentRegion if cell.Interior.ColorIndex = 4 then cell.Locked = True end if Next ActiveSheet.Protect -- Regards, Tom Ogilvy "mika." wrote in message ... One way might be to change the background of the cells containing the data I want locked (call it old data) to green. Then I enter my new data (that doesn't need to be protected)on white rows. Then I can sort the data, and close the spreadsheet. Every time the spreadsheet opens, I could have a macro that does the following: - Checks if the worksheet is protected, and if so unprotects it - for all cells, if background is green, lock, else unlock - reprotect the sheet. Can anyone see a problem with this? Also, can anyone help me code the macro or provide me some resources to do so? Thanks. -----Original Message----- Hello, I locked certain cells on my worksheet, and then protected the worksheet. However, now I wish to sort the data, but keep the data that was in the protected cells protected. Since certain cells are locked and not data, when I perform a sort, only those same cells are protected, rather than the data being protected. Is there any way I can protect the data instead? Thanks for the help! . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2003 - Protecting Cells but allowing external data updates | Excel Worksheet Functions | |||
protecting cells | Excel Worksheet Functions | |||
Protecting cells but maintaing data groups | Excel Discussion (Misc queries) | |||
Protecting Validated cells from pasting over data | Excel Discussion (Misc queries) | |||
Protecting cells | Excel Discussion (Misc queries) |