Hello,
I have a listbox whose selections hide or unhide particular columns. I receive a run-time error 1004 only when I attempt to use this after just having activated the protected workbook. If I unprotect the workbook and reprotect it, the listbox functions properly from then on. I only have trouble if I haven't yet unprotected it.
I have unlocked all of the cells in the columns I am hiding as I thought this might be the issue. Can anyone offer me some suggestions? Here is the code I'm using with the error messages listed below:
Public Sub Hide_Graph()
Application.ScreenUpdating = False
Application.EnableEvents = False
If [Display_Selected] = 2 Then
Worksheets("Exhibit Summary").Range("G:Y").EntireColumn.Hidden = True
Worksheets("Exhibit Summary").Range("AA:AJ").EntireColumn.Hidden = False
ElseIf [Display_Selected] = 1 Then
Worksheets("Exhibit Summary").Range("AA:AJ").EntireColumn.Hidden = True
Worksheets("Exhibit Summary").Range("G:Y").EntireColumn.Hidden = False
Else
Worksheets("Exhibit Summary").Range("G:AJ").EntireColumn.Hidden = False
End If
ActiveSheet.Range("A1").Select
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
“400” Error message
“Run-time error ‘1004’:
Application-defined or object-defined error”
Thanks ahead of time!
Joe
Bookmarks