L
Lostguy
Hello!
I need to have Excel 2003 automatically adjust row height for
protected cells with text. Here are the two codes I have. Which is
better, Worksheet Calculate or Selection Change? Also, what is the
difference between Range("A28:32) and Rows ("28:32")? Basically, is
one of these codes better than the other? s there anything you would
recommend to increase their reliability? Thanks! VR/Lost
Private Sub Worksheet_Calculate()
Application.EnableEvents = False
ActiveSheet.Unprotect "password"
Range("a28:32").EntireRow.AutoFit
ActiveSheet.Protect "password"
Application.EnableEvents = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo enditall
Application.EnableEvents = False
Rows("28:32").AutoFit
Rows("53").AutoFit
enditall:
Application.EnableEvents = True
End Sub
I need to have Excel 2003 automatically adjust row height for
protected cells with text. Here are the two codes I have. Which is
better, Worksheet Calculate or Selection Change? Also, what is the
difference between Range("A28:32) and Rows ("28:32")? Basically, is
one of these codes better than the other? s there anything you would
recommend to increase their reliability? Thanks! VR/Lost
Private Sub Worksheet_Calculate()
Application.EnableEvents = False
ActiveSheet.Unprotect "password"
Range("a28:32").EntireRow.AutoFit
ActiveSheet.Protect "password"
Application.EnableEvents = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo enditall
Application.EnableEvents = False
Rows("28:32").AutoFit
Rows("53").AutoFit
enditall:
Application.EnableEvents = True
End Sub