Results 1 to 5 of 5

Excel 2003 macro not working in 2010

Threaded View

  1. #1
    Registered User
    Join Date
    05-23-2012
    Location
    Torrance
    MS-Off Ver
    Excel 2010
    Posts
    3

    Excel 2003 macro not working in 2010

    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
    Last edited by arlu1201; 05-23-2012 at 02:00 PM. Reason: Use code tags in future.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1