I have the following macro that works on excel 2003 but it doesn't work on 2010. I lower the macro security levels thinking that was the problem but I think it has to be the sintax on 2010 and VBA.
Thanks in advance fo your help.
Sub lockmonday()
'
' lockmonday Macro
'Sub Msgbox_Yes_No()
'Dim Response As Integer
' Displays a message box with the yes and no options.
Response = MsgBox(prompt:="Lock Records'Yes' or 'No'.", Buttons:=vbYesNo)
' If statement to check if the yes button was selected.
If Response = vbYes Then
ActiveSheet.Protect UserInterfaceOnly:=True
Range("E9:E240").Select
Selection.Locked = True
Selection.FormulaHidden = False
Range("E9:E240").Select
Selection.FormatConditions.Delete
Range("E9:E240").Select
With Selection.Interior
.ColorIndex = 43
.Pattern = xlSolid
End With
Else
' The no button was selected.
MsgBox "Records Not Locked."
End If
End Sub
Bookmarks