How do i delete a row in a excel worksheet that is protected

G

Guest

I have an excel worksheet that contains all of our prices, the sales group
wants to take a copy of that and create proposals, the sheet is password
protected so no one can change the prices, the problem is, the sales group
want to delete unneeded rows of information, how can i allow them to do that
if its protected
 
R

Ron de Bruin

Hi Jim

If you and the sales people are using 2002/2003 you can mark this option when you protect your sheet.
It is also possible with code in all versions, post back if you want a example.
 
R

Ron de Bruin

Hi Jim

Try this on a test workbook first

Protect your worksheets with code with userfaceonly like this
Place this in the Thisworkbook module.

Right click on the Excel icon next to File in the menubar
And choose View code

You are now in the Thisworkbook module
Paste the Event in this place
Alt-Q to go back to Excel

Private Sub Workbook_Open()
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
sh.Protect "ABCD", , , userinterfaceonly:=True
Next sh
End Sub

All sheets are protected now with the password "ABCD" and if you add a button on your sheet
with a macro like this

Sub delrows()
Selection.EntireRow.Delete
End Sub

The user can delete rows
 

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