Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Default Auto Row Height Protected Template

Hi,

I have a template that I created in Excel.
When I enter text in the unlocked cells I'd like for the row height to automatically adjust (it's on wrap text at the moment).

I'm not very familiar with macro coding, so how do I do this?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Auto Row Height Protected Template

Hi,

Try this code. You'll need to put it in the sheet's code (right-click tab name and click "View Code").

- Ben

Private Sub Worksheet_Change(ByVal Target As Range)
Dim strPWD As String
'Plug in sheet password to unprotect
strPWD = ""

If Not Target.Locked Then
If Sheet1.ProtectContents = True Then
Sheet1.Unprotect (strPWD)
Target.Rows.EntireRow.AutoFit
Sheet1.Protect (strPWD)
Else
Target.Rows.EntireRow.AutoFit
End If
End If
End Sub
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
Auto fit row height Fountain Excel Worksheet Functions 2 January 21st 10 01:21 AM
AUTO ROW HEIGHT manutt Excel Worksheet Functions 2 January 10th 09 11:45 PM
Row Height - Auto-Fit Bajillian Excel Discussion (Misc queries) 1 September 11th 08 02:13 PM
Auto Row Height RemySS Excel Programming 1 January 13th 06 07:49 PM
how do you change a row height in a protected worksheet Vince[_5_] Excel Programming 3 August 1st 04 06:35 AM


All times are GMT +1. The time now is 05:06 AM.

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

About Us

"It's about Microsoft Excel"