Clearing data from Excel 2003 Form

B

berniean

Hi, I have an Excel Form with cells for direct data entry and cells with
formulas. The form is protected so that only those cells for direct data
entry are editable. All the other cells are locked. I want to create a macro
to clear all the data from the unlocked cells. I recorded a macro using the
F5 (goto) function key, the shift key to select contiguous cells, and the
delete key to clear those cells. The problem is, if I move anything on the
form, the cell references in the macro don't change. I have to edit the macro
in the vb editor.

Is there a way to select, in a protected sheet, all unlocked cells and
delete their contents, without using cell references that may change when the
form is changed?

Any help is greatly appreciated,
Bernie
 
B

berniean

Thank you for the response. Unfortunately, the first code doesn't work on
protected sheets. The second code started to work but stopped when it hit a
merged cell. I get "Run time error '1004': Cannot change part of a merged
cell." Do you know of a way around that?
Thanks again, Bernie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top