VBA锁定指定单元格

If rs.RecordCount > 0 Then
                .Range("AF4").Value = pjno
                MsgBox "This project number does exists Please create a new one !", 16
                .Range("A1:AH56").Locked = False
                .Range("F6:M6").Locked = True
                ActiveSheet.Protect Password:="locked"
                Exit Sub
Else
               
                
                .Range("AF4").Value = pjno
            
End If

猜你喜欢

转载自www.cnblogs.com/luoye00/p/10863536.html