Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excel editing control

Status
Not open for further replies.

hinchdog

Programmer
Feb 14, 2001
380
US
i know you can open an excel document as read-only, but is it possible to open it a read-write then control which cells of the page can be edited and which cannot using vb? is this something only a macro can do? also, can you make it so they cannot save the worksheet as anything other than what it was originally named?

thanks
 
You can toggle the protection of certain cells on a worksheet. If you only want the user to modify certain cells, select them then Format>Cells>Protection and uncheck the Locked box. Then, protect the sheet and all of the other cells are now protected. You can change the protection with VB, but this much easier to do.

Do you mean save the worksheet or workbook? You can check the name of the active workbook to make sure that it has not changed. You can also do this with worksheets. You'll need to be a little more specific.
 
well i want them to be able to change certain cells of a worksheet then save them. but i don't want them to be able to rename the worksheet. does that make sense? thanks for you help too.
 
To disable saving under a different name, use the code

Application.CommandBars(1).Controls(1).Controls("Save as...").Enabled = False

to disable the save as command. You'd insert this statement into the workbook_windowactivate event sub in the code for ThisWorkbook. To be nice, you'd also want to insert a statement to re-enable the command in the windowdeactivate event sub.
Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top