Resize a password protected page

M

Michael Lanier

I need to resize a password protected page. The current macro works
great when the page is not password protected.

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("G15").Value = "Resize" Then
ActiveWindow.DisplayHeadings = False
Columns("C:C").ColumnWidth = Range("C17").Value
Columns("G:G").ColumnWidth = Range("C18").Value
Rows("1:1").RowHeight = Range("C15").Value
Rows("6:6").RowHeight = Range("C16").Value
End If
End Sub

Can you help with this. Let's presume the password is "BigBird."

Thanks,

Michael
 
J

Jim Cone

Unprotect the sheet, run the code, protect the sheet...
'--
Private Sub Worksheet_Change(ByVal Target As Range)
If Me.Range("G15").Value = "Resize" Then
Me.Unprotect "BigBird."
ActiveWindow.DisplayHeadings = False
Me.Columns("C:C").ColumnWidth = Me.Range("C17").Value
Me.Columns("G:G").ColumnWidth = Me.Range("C18").Value
Me.Rows("1:1").RowHeight = Me.Range("C15").Value
Me.Rows("6:6").RowHeight = Me.Range("C16").Value
Me.Protect "BigBird."
End If
End Sub
'--
Jim Cone
Portland, Oregon USA
( http://tinyurl.com/PrimitiveSoftware )




"Michael Lanier" <[email protected]>
wrote in message I need to resize a password protected page. The current macro works
great when the page is not password protected.

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("G15").Value = "Resize" Then
ActiveWindow.DisplayHeadings = False
Columns("C:C").ColumnWidth = Range("C17").Value
Columns("G:G").ColumnWidth = Range("C18").Value
Rows("1:1").RowHeight = Range("C15").Value
Rows("6:6").RowHeight = Range("C16").Value
End If
End Sub

Can you help with this. Let's presume the password is "BigBird."
Thanks,
Michael
 
M

Michael Lanier

Thanks Jim for your help. I'll give it a try in the morning when I
can think better.

Michael
 

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

Top