Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 152
Default Auto fit text in cell of a protected worksheet

Good afternoon.

I have a form with protection and validation in several cells; some are left
unlocked/no validation to allow for free form text entries. My problem is
that when i protect the sheet, Excel doesn't auto fit the text in the
column/row and the user is not able to either. (I don't want to allow Format
row height / column width in Protection options, as I don't want any hidden
rows/columns unhidden, which these protection options allow)

Is there a way to allow the user to modify the row height and column with of
the unlocked text cells (as needed) while the sheet remains protected?

Or a way for Excel to do this automatically? I have wrap text selected in
the cell format options.

Thanks! -- Suzanne.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Auto fit text in cell of a protected worksheet

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then 'adjust to suit
Me.Unprotect Password:="justme"
n = Target.Row
With Me.Range("A" & n)
If .Value < "" Then
.Cells.WrapText = True
.AutoFit = True
End If
End With
End If
enditall:
Application.EnableEvents = True
Me.Protect Password:="justme"
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code"

Copy/paste the code into that sheet module. Alt + q to return to the Excel
window.


Gord Dibben MS Excel MVP

On Mon, 7 Jul 2008 10:35:01 -0700, Suzanne
wrote:

Good afternoon.

I have a form with protection and validation in several cells; some are left
unlocked/no validation to allow for free form text entries. My problem is
that when i protect the sheet, Excel doesn't auto fit the text in the
column/row and the user is not able to either. (I don't want to allow Format
row height / column width in Protection options, as I don't want any hidden
rows/columns unhidden, which these protection options allow)

Is there a way to allow the user to modify the row height and column with of
the unlocked text cells (as needed) while the sheet remains protected?

Or a way for Excel to do this automatically? I have wrap text selected in
the cell format options.

Thanks! -- Suzanne.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 152
Default Auto fit text in cell of a protected worksheet

Thanks so much, i had a feeling you'd be the one to respond : ) Thanks for
coming thru for me yet again. Cheers!
--
Thank you -- Suzanne.


"Gord Dibben" wrote:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then 'adjust to suit
Me.Unprotect Password:="justme"
n = Target.Row
With Me.Range("A" & n)
If .Value < "" Then
.Cells.WrapText = True
.AutoFit = True
End If
End With
End If
enditall:
Application.EnableEvents = True
Me.Protect Password:="justme"
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code"

Copy/paste the code into that sheet module. Alt + q to return to the Excel
window.


Gord Dibben MS Excel MVP

On Mon, 7 Jul 2008 10:35:01 -0700, Suzanne
wrote:

Good afternoon.

I have a form with protection and validation in several cells; some are left
unlocked/no validation to allow for free form text entries. My problem is
that when i protect the sheet, Excel doesn't auto fit the text in the
column/row and the user is not able to either. (I don't want to allow Format
row height / column width in Protection options, as I don't want any hidden
rows/columns unhidden, which these protection options allow)

Is there a way to allow the user to modify the row height and column with of
the unlocked text cells (as needed) while the sheet remains protected?

Or a way for Excel to do this automatically? I have wrap text selected in
the cell format options.

Thanks! -- Suzanne.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Auto fit text in cell of a protected worksheet

Thanks for the feedback.

Happy to assist.


Gord

On Tue, 8 Jul 2008 10:22:09 -0700, Suzanne
wrote:

Thanks so much, i had a feeling you'd be the one to respond : ) Thanks for
coming thru for me yet again. Cheers!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use auto filter in a protected worksheet James Excel Discussion (Misc queries) 6 June 2nd 15 03:18 AM
Edit text format in non-protected cells in protected worksheet Bonnie Excel Discussion (Misc queries) 2 April 19th 08 04:48 PM
Help with using Auto-filter in a protected Worksheet. Ayo Excel Discussion (Misc queries) 5 October 29th 07 04:10 PM
Auto Filter with Protected Worksheet JohnGuts Excel Worksheet Functions 4 April 24th 06 09:14 AM
HOW CAN I AUTO FILL A CELL WITH TEXT FROM ANOTHER WORKSHEET TEXT . waz Excel Worksheet Functions 2 December 29th 04 07:49 PM


All times are GMT +1. The time now is 05:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"