ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Change cell format based on its color (https://www.excelbanter.com/excel-programming/343348-change-cell-format-based-its-color.html)

Anders[_7_]

Change cell format based on its color
 
Dear Experts

Being new to VBA I have following question.
In an Excel 2003 workbook, where all cells as default are protected, I
would like to unprotect cells with a specific color.
Can any of you give a clue?

Thanks in advance
Anders
Copenhagen


Tom Ogilvy

Change cell format based on its color
 
Is the color produce by conditional formatting?

If not

assuming the sheet is unprotected.

For each cell in activesheet.UsedRange
if cell.interior.ColorIndex = 5
cell.Locked = False
end if
Next

--
Regards,
Tom Ogilvy

"Anders" wrote in message
oups.com...
Dear Experts

Being new to VBA I have following question.
In an Excel 2003 workbook, where all cells as default are protected, I
would like to unprotect cells with a specific color.
Can any of you give a clue?

Thanks in advance
Anders
Copenhagen




Anders[_7_]

Change cell format based on its color
 
Is it really that simple!
Thanks a lot Tom - my problem is solved.
Br
Anders



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

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