I don't know what the original code looks like but you probably need to
unprotect the sheet and protect it again in your macro something like:
ActiveSheet.Unprotect Password:="thepassword"
'rest of code
ActiveSheet.Protect Password:="thepassword"
Hope this helps
Rowan
"Cathy Landry" wrote:
Larry, Thank you for the input. The code did work, but I do have another
small problem. I used the code as a macro and assigned it to a button.
Ideally, we want users to be able to click the button to generate a
po#......which it does, but we also want the cell locked so they cannot
change the number or create their own. When the macro is run a box pops up
asking for a password as the cell has been locked. Is there a way to put
that into the code so the macro will run and not generate that message?
Thank you
Cathy
|