Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9159

Re: Locking rows based on value in cells

$
0
0

Hello Shrikant,

 

Thanks for your reply.

I did what you suggested but it has the same behavior.

 

Function AFTER_REFRESH(ByVal Target As Range)

 

Dim ca As Range

 

    ActiveSheet.Unprotect "test"

   

    If Target.Column = 7 Then

        For Each ca In Target.Cells

            If ca.Value = 1 And ca.Column = 7 Then

                Range("a" & ca.Row & ":d" & ca.Row).Locked = True

               AFTER_REFRESH = True

            Else

                Range("a" & ca.Row & ":d" & ca.Row).Locked = False

                 AFTER_REFRESH = True

            End If

        Next

    End If

    ActiveSheet.Protect "test"

 

End Function

 

Could you please let me know if I'm missing something or doing wrong?

 

Thanks a lot & Best Regards,

Zaire


Viewing all articles
Browse latest Browse all 9159

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>