View Single Post
 
Old 02-22-2016, 03:00 AM
wpryan wpryan is offline Windows 10 Office 2016
Novice
 
Join Date: Oct 2013
Location: Orlando, FL USA
Posts: 26
wpryan is on a distinguished road
Default

Hi, I decided to change the code to reference named ranges instead of "UsedRange". However I am getting error 1004, Application or Object Defined Error on the line which is in red. I can't figure this out... Modified code:
Code:
Sub ClearUnlockedCells()

Dim msg As String, ans As Variant
 
    msg = "Completing this action will delete all form data! Continue?"
    ans = msgbox(msg, vbOKCancel, "Z-Models SCP Info")

    Select Case ans
    Case vbOK

        Application.ScreenUpdating = False
        'On Error Resume Next
        Application.DisplayAlerts = False
        
        Range("Z_GD") = ""
            
        Application.DisplayAlerts = True
        Application.ScreenUpdating = True
        
        
    Case vbCancel
    End Select

    Sheets("General Data").Range("B4").Select
    
End Sub
Reply With Quote