K
Kirstie Adam
Hi all,
Gord Dibben of thes boards recently helped me out with some code to unlock
certain columns on my spreadsheet, which works fine, but now i need an
amendment......
The code below unlocks one column at a time, but i need to unlock 3 columns
at a time, columns 1,2,3 and 11 and 1,2,3 and 12 respectively.
I have tried creating a union, and then unlocking the columns in that union,
but don't know enough and wasn't sure i was doing it correctly.
I also tried .Columns(1,2,3,11) and .Columns(1),(2) etc, but again, i just
can't get it!
Any help would be appreciated!
Private Sub Workbook_Open()
Dim pword As String
With Sheets("Sheet1")
.Activate
.Unprotect Password:="kirst"
.Cells.Locked = True
End With
pword = InputBox("Enter Your Password")
Select Case pword
Case Is = "gainv": Columns(11).Cells.Locked = False
Case Is = "msauth": Columns(12).Cells.Locked = False
End Select
ActiveSheet.Protect Password:="kirst"
End Sub
Thanks,
Kirstie
Gord Dibben of thes boards recently helped me out with some code to unlock
certain columns on my spreadsheet, which works fine, but now i need an
amendment......
The code below unlocks one column at a time, but i need to unlock 3 columns
at a time, columns 1,2,3 and 11 and 1,2,3 and 12 respectively.
I have tried creating a union, and then unlocking the columns in that union,
but don't know enough and wasn't sure i was doing it correctly.
I also tried .Columns(1,2,3,11) and .Columns(1),(2) etc, but again, i just
can't get it!
Any help would be appreciated!
Private Sub Workbook_Open()
Dim pword As String
With Sheets("Sheet1")
.Activate
.Unprotect Password:="kirst"
.Cells.Locked = True
End With
pword = InputBox("Enter Your Password")
Select Case pword
Case Is = "gainv": Columns(11).Cells.Locked = False
Case Is = "msauth": Columns(12).Cells.Locked = False
End Select
ActiveSheet.Protect Password:="kirst"
End Sub
Thanks,
Kirstie