Runtime Error 1004: Hidden Property

KMacattack

New Member
Joined
Nov 24, 2008
Messages
11
I am getting a Runtime Error 1004: Unable to set the Hidden property of the Range class

I have a macro that updates a bunch of pivot tables based on selections from data validation dropdowns.
(this works fine)

Based on the users selections I want to hide and unhide various rows.

i do this in two steps:
from the code to update the pivot table:
goes to a function to specify the which rows to hide or unhide (collapse):

Code:
Public Sub Collapse()
Sheets("Exhibit").Activate
'Unhide all rows
    UnHide 13, 200
'hide/unhide month 
       'Hides the Months after the month given in Cell A5
        hide 16 + (Month(Sheets("Exhibit").Range("A5"))), 28
    End If
< ... there is more of similar code below ... >       
   End sub

The Unhide and Hide are separate functions.

Code:
Sub hide(R1, R2)
'Hides rows R1 to R2 in Exhibit Tab
    ActiveSheet.Rows(R1 & ":" & R2).Hidden = True
End Sub
---------------------------------------------------------
Sub UnHide(R1, R2)
'Unhides Rows R1 to R2 in Exhibit Tab
    ActiveSheet.Rows(R1 & ":" & R2).Hidden = False
End Sub

And when the code gets to the unhide 13,200 function i get that error.

My workbook is unprotected and unlocked: as i found in many other forms that was the problem.

the other thing is that it sometimes works and other times doesn't and i can't pinpoint the situation that makes it happen.

so if anyone has a fix or reason for this please help.

Thank You

Mac
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,214,584
Messages
6,120,387
Members
448,957
Latest member
Hat4Life

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top