Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Auto fit row height | Excel Worksheet Functions | |||
AUTO ROW HEIGHT | Excel Worksheet Functions | |||
Row Height - Auto-Fit | Excel Discussion (Misc queries) | |||
Auto Row Height | Excel Programming | |||
how do you change a row height in a protected worksheet | Excel Programming |