B
BEEJAY
The following produces the run time error, even though
that part is an actual copy of a recorded macro.
What am I missing?
Option Explicit
Private Sub REmove_Net_Pricing_Info_Click()
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
If ws.ProtectContents = True Then
ws.Unprotect ("xxx")
End If
Next
ActiveWorkbook.Unprotect (["xxx1"])
Sheets("Options").Select
THIS is were the error shows up
Range("C6").Select
Selection.ClearContents
Range("H6:I6").Select
Selection.ClearContents
Sheets("Pricing").Select
Range("C120").Select
Selection.ClearContents
Range("C121").Select
Selection.ClearContents
Sheets("Contract").Select
Range("B1").Select
If ws.ProtectContents = False Then
ws.Protect ("xxx")
End If
Application.ScreenUpdating = True
End Sub
that part is an actual copy of a recorded macro.
What am I missing?
Option Explicit
Private Sub REmove_Net_Pricing_Info_Click()
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
If ws.ProtectContents = True Then
ws.Unprotect ("xxx")
End If
Next
ActiveWorkbook.Unprotect (["xxx1"])
Sheets("Options").Select
THIS is were the error shows up
Range("C6").Select
Selection.ClearContents
Range("H6:I6").Select
Selection.ClearContents
Sheets("Pricing").Select
Range("C120").Select
Selection.ClearContents
Range("C121").Select
Selection.ClearContents
Sheets("Contract").Select
Range("B1").Select
If ws.ProtectContents = False Then
ws.Protect ("xxx")
End If
Application.ScreenUpdating = True
End Sub