napi15
napi15

Reputation: 2402

How to enable Cell re-size on protected Excel Sheet

I have a macro that disable some row based on the value of others row , witch is working fine

 Private Sub Worksheet_Change(ByVal Target As Range)
    Call SecurityColumnsLookup(Target)
End Sub
Private Sub Workbook_Open(ByVal Target As Range)
    Call SecurityColumnsLookup(Target)
End Sub
Private Sub SecurityColumnsLookup(ByVal Target As Range)
On Error GoTo MyErr
    Err.Clear
    ActiveSheet.Unprotect

    Application.EnableEvents = False
 Select Case Range("V" & (Target.Row)).Value
   //do stuff


    End Select
 ActiveSheet.Protect
    Application.EnableEvents = True
    Exit Sub
MyErr:
    On Error Resume Next
 ActiveSheet.Protect
    Application.EnableEvents = True
    Exit Sub
End Sub
 Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        Call SecurityColumnsLookup(Target)
    End Sub

What I would like to know is how to add code to my Macro in order to allow user to re-size his rows , because what is happening right now , is when the macro is active and I mouse mouse over the cell the re-size icon doesn't appear

Is it possible to enable re-sizet feature at any time?

Thank you

Upvotes: 1

Views: 643

Answers (1)

napi15
napi15

Reputation: 2402

I found the solution to my problem , as explained in this link

http://www.thespreadsheetguru.com/the-code-vault/2014/2/21/protect-worksheet-but-allow-formatting-and-hiding-rows-columns

Adding this

    ActiveSheet.Protect , AllowFormattingColumns:=True, AllowFormattingRows:=True
Application.EnableEvents = True

Will let my Macro enable the resize option !

Upvotes: 1

Related Questions