EliseFreedman
Programmer
Hi There
I have a series of workbooks where I want to protect the data to prevent users altering the data by mistake.
I could go through and protect the relevant cells manually but I was hoping to make life easier for myself and do it using code.
I want to be able to cycle through all the cells and if the cell has a value then the cell should be locked. If it is blank then the cell should be left unlocked.
I have tried various bits of code from the web but with no luck. I think part of the issue may be that Some of the cells in the worksheet are merged cells. Theoretically I could change the sheet so that there are no merged cells but if im going to have to do that then I might as well just protect the cells manually instead)
Can anyone help
I have a series of workbooks where I want to protect the data to prevent users altering the data by mistake.
I could go through and protect the relevant cells manually but I was hoping to make life easier for myself and do it using code.
I want to be able to cycle through all the cells and if the cell has a value then the cell should be locked. If it is blank then the cell should be left unlocked.
I have tried various bits of code from the web but with no luck. I think part of the issue may be that Some of the cells in the worksheet are merged cells. Theoretically I could change the sheet so that there are no merged cells but if im going to have to do that then I might as well just protect the cells manually instead)
Can anyone help