Lock worksheet, but still be able to adjust column width?

  • Thread starter Thread starter Phoenix
  • Start date Start date
Hi
not sure if this is available in Excel 2000 but in Excel 2003 the
protection dialog contains checkboxes for
'Format rows' and 'Format columns'. Check theses and you can adjust the
column width manually
 
You could unprotect the worksheet, adjust the column width, and reprotect the
worksheet.

Try recording a macro when you do it manually. I modified my recorded macro to
get this:

Option Explicit
Sub testme()
With ActiveSheet
.Unprotect Password:="hi"
.Columns("E:E").ColumnWidth = 14.57
'.Columns("e:e").AutoFit
.Protect Password:="hi"
End With
End Sub
 
Thanx for the tips, but the conclusion is that it cant't be done i
Excel 2003. Cause the point is that other persons can be able to adjus
column width, without knowing the password and unprotect it :)


Phoeni
 
No, that shouldn't be your conclusion.

My post was in case you are running a version of excel before xl2002. Starting
with xl2002, you can protect the sheet and allow column formatting.

Your original post referred to xl2000. Did you mean that or xl2003?

(typo in this message or the original????)
 
Sorry, I meant 2000 :-) What you are saying is that I should record
macro that says: Unprotect--->adjust column--->Protect.
The problem then will be that other persons can unhide the column whil
it's unprotected. Am I getting you right?


Dave said:
No, that shouldn't be your conclusion.

My post was in case you are running a version of excel before xl2002
Starting
with xl2002, you can protect the sheet and allow column formatting.

Your original post referred to xl2000. Did you mean that or xl2003?

(typo in this message or the original????
 
I thought that you (in code) would know how wide to set the columnwidth.

If you want to let the user change the width, you could pop up that dialogbox
(Format|Column|Width):

Option Explicit
Sub testme()
With ActiveSheet
.Unprotect Password:="hi"
Application.Dialogs(xlDialogColumnWidth).Show
.Protect Password:="hi"
End With
End Sub

You could even limit their selection within the code--so that they could only do
one column at at time:

Option Explicit
Sub testme()
With ActiveSheet
.Unprotect Password:="hi"
Selection(1).Select 'just one column at a time???
Application.Dialogs(xlDialogColumnWidth).Show
.Protect Password:="hi"
End With
End Sub



Phoenix < said:
Sorry, I meant 2000 :-) What you are saying is that I should record a
macro that says: Unprotect--->adjust column--->Protect.
The problem then will be that other persons can unhide the column while
it's unprotected. Am I getting you right?

Dave said:
No, that shouldn't be your conclusion.

My post was in case you are running a version of excel before xl2002.
Starting
with xl2002, you can protect the sheet and allow column formatting.

Your original post referred to xl2000. Did you mean that or xl2003?

(typo in this message or the original????)

 

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

Back
Top