Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
to the following syntax what can be added so that I can put a password (2468)
on the protection of the sheet. Right now, this sheet automatically protects itself and I want to add a password. Can a macro automatically enter a password (2468) upon its protection of the sheet? Option Explicit Private Sub worksheet_change(ByVal target As Range) Dim rngDV As Range Dim oldVal As String Dim newVal As String If target.Count 1 Then GoTo exitHandler On Error Resume Next Set rngDV = Cells.SpecialCells(xlCellTypeAllValidation) On Error GoTo exitHandler If rngDV Is Nothing Then GoTo exitHandler If Intersect(target, rngDV) Is Nothing Then 'do nothing Else Application.EnableEvents = False newVal = target.Value Application.Undo oldVal = target.Value target.Value = newVal If target.Column = 11 Then If oldVal = "" Then 'do nothing Else If newVal = "" Then 'do nothing Else target.Value = oldVal _ & ", " & newVal End If End If End If End If exitHandler: Application.EnableEvents = True If target.Cells.Count 1 Then Exit Sub If target.Row < 10 Or target.Row 13 Then Exit Sub Application.EnableEvents = False If target.Column = 2 Then If IsNumeric(target) = False Then If Len(target) 0 Then target.Offset(0, 4) = "" End If End If End If Application.EnableEvents = True End Sub Thank You |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Password protection in macro ( Anybody can view my password in VB | Excel Discussion (Misc queries) | |||
Excel Data Protection- AKA: Sheet/Macro Password Protection | Setting up and Configuration of Excel | |||
password protection macro - HELP???? | Excel Discussion (Misc queries) | |||
Macro override password protection | Excel Programming | |||
How to add a macro with password protection | Excel Programming |