I have disabled access to certain cells in a spreadsheet through a macro but it appears that the option to select the locked cells is still on. What do I do to correct this? I have attached my macro for reference.
If FormatCustomer Then
Workbooks.Open Filename:="C:\my documents\Customers.xls"
'Format IDs as General
Selection.NumberFormat = "General"
'Set font to nine pitch
.Name = "Tahoma"
.Size = 9
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
'Set Columns to autofit
'Rename tab sheet1 to Customers
Sheets("Sheet1").Name = "Customers"
'Define Name Billto
rowa = Sheets("Customers").Cells(Rows.Count, 1).End(xlUp).Row
ActiveWorkbook.Names.Add Name:="Billto", RefersToR1C1:="=Customers!R2C2:R" & rowa & "C2" & Chr(32)
'Define Name BillToList
rowb = Sheets("Customers").Cells(Rows.Count, 1).End(xlUp).Row
ActiveWorkbook.Names.Add Name:="BillToLookup", RefersToR1C1:="=Customers!R2C1:R" & rowb & "C8" & Chr(32)
'Define Name BillToLookup
ActiveWorkbook.Names.Add Name:="BillToList", RefersToR1C1:="=OFFSET(Customers!R2C1,0,0,COUNTA(Customers!C1)-1)"
'Protect Customers Worksheet
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, Password:="password"
ActiveSheet.EnableSelection = xlLockedCells
'Go to first cell on worksheet
'Save with same name as opened