HURTMYPONY
Board Regular
- Joined
- Oct 27, 2003
- Messages
- 166
Hello, all!
I have created a sheet with cells that have specific cell ranges containing dropdown data validation lists and others with formulas and values, all of which need to be selectively protected.
Some of the other cells on the sheet must allow direct input of any value.
You folks might have a better approach for me, but I think I need:
G3:H4
G6:H13
H15:I15
H18:H25
H27:I27
There are more ranges than above but this should give you a good idea of it.
I know how to manually protect the cells and I also know how to unprotect the whole sheet via VBA.
I guess I just don’t know how to use VBA to:
I am also open to a better approach if I’ve over-complicated things…
I've attached an image of the sheet for visual reference.
The ranges highlighted in yellow are a combination of cells with data validation - lists and formulas that need protection before and after the scripts run.
I have created a sheet with cells that have specific cell ranges containing dropdown data validation lists and others with formulas and values, all of which need to be selectively protected.
Some of the other cells on the sheet must allow direct input of any value.
You folks might have a better approach for me, but I think I need:
- The specific cell ranges (data validation lists, formulas) to remain protected from users until a macro is called (via button).
- Unprotect those cells to allow the macro/VBA(s) script to work.
- Re-protect the specific cell ranges after the macro/VBA script(s) have run.
G3:H4
G6:H13
H15:I15
H18:H25
H27:I27
There are more ranges than above but this should give you a good idea of it.
I know how to manually protect the cells and I also know how to unprotect the whole sheet via VBA.
I guess I just don’t know how to use VBA to:
- Re-protect specific cell ranges.
- Allow the cells with data validation lists to only allow what is on the associated lists.
I am also open to a better approach if I’ve over-complicated things…
I've attached an image of the sheet for visual reference.
The ranges highlighted in yellow are a combination of cells with data validation - lists and formulas that need protection before and after the scripts run.