+ Reply to Thread
Results 1 to 3 of 3

Unable to set Hidden Property

  1. #1
    Forum Contributor
    Join Date
    05-19-2004
    Location
    United States
    MS-Off Ver
    Office XP and Office 2003
    Posts
    127

    Unable to set Hidden Property

    I have the following code. It is failing on the hilited line. I am getting a Run-time error '1004', Unable to set Hidden property of the Range class. I checked and the range name does exist. The HideMonths and HideYr5 variables are both equal to True. If I comment out the line, everything finishes processing ok.

    Sheets("Other_Input").Select
    Range("OthMonthlyYr1").EntireColumn.Hidden = HideMonths
    Range("OthMonthlyYr2").EntireColumn.Hidden = HideMonths Or HideYr2
    Range("OthMonthlyYr3").EntireColumn.Hidden = HideMonths Or HideYr3
    Range("OthMonthlyYr4").EntireColumn.Hidden = HideMonths Or HideYr4
    Range("OthMonthlyYr5").EntireColumn.Hidden = HideMonths Or HideYr5


    I even tried Worksheets("Other_Input").Range("OthMonthlyYr5").EntireColumn.Hidden = HideMonths Or HideYr5, but that didn't work either.

    Can anyone help me?

  2. #2
    Tim Williams
    Guest

    Re: Unable to set Hidden Property

    merged cells?

    Tim


    "LAF" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I have the following code. It is failing on the hilited line. I am
    > getting a Run-time error '1004', Unable to set Hidden property of
    > the
    > Range class. I checked and the range name does exist. The
    > HideMonths
    > and HideYr5 variables are both equal to True. If I comment out the
    > line, everything finishes processing ok.
    >
    > Sheets("Other_Input").Select
    > Range("OthMonthlyYr1").EntireColumn.Hidden = HideMonths
    > Range("OthMonthlyYr2").EntireColumn.Hidden = HideMonths Or
    > HideYr2
    > Range("OthMonthlyYr3").EntireColumn.Hidden = HideMonths Or
    > HideYr3
    > Range("OthMonthlyYr4").EntireColumn.Hidden = HideMonths Or
    > HideYr4
    > Range("OthMonthlyYr5").EntireColumn.Hidden = HideMonths Or
    > HideYr5
    >
    >
    > I even tried
    > Worksheets("Other_Input").Range("OthMonthlyYr5").EntireColumn.Hidden
    > =
    > HideMonths Or HideYr5, but that didn't work either.
    >
    > Can anyone help me?
    >
    >
    > --
    > LAF
    > ------------------------------------------------------------------------
    > LAF's Profile:
    > http://www.excelforum.com/member.php...fo&userid=9656
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=398466
    >




  3. #3
    Jean-Yves
    Guest

    Re: Unable to set Hidden Property

    Hi,
    I had that problem if some cells contained comments.
    Regards,
    Jean-Yves


    "LAF" <[email protected]> wrote in message
    news:[email protected]...
    >
    > I have the following code. It is failing on the hilited line. I am
    > getting a Run-time error '1004', Unable to set Hidden property of the
    > Range class. I checked and the range name does exist. The HideMonths
    > and HideYr5 variables are both equal to True. If I comment out the
    > line, everything finishes processing ok.
    >
    > Sheets("Other_Input").Select
    > Range("OthMonthlyYr1").EntireColumn.Hidden = HideMonths
    > Range("OthMonthlyYr2").EntireColumn.Hidden = HideMonths Or
    > HideYr2
    > Range("OthMonthlyYr3").EntireColumn.Hidden = HideMonths Or
    > HideYr3
    > Range("OthMonthlyYr4").EntireColumn.Hidden = HideMonths Or
    > HideYr4
    > Range("OthMonthlyYr5").EntireColumn.Hidden = HideMonths Or
    > HideYr5
    >
    >
    > I even tried
    > Worksheets("Other_Input").Range("OthMonthlyYr5").EntireColumn.Hidden =
    > HideMonths Or HideYr5, but that didn't work either.
    >
    > Can anyone help me?
    >
    >
    > --
    > LAF
    > ------------------------------------------------------------------------
    > LAF's Profile:

    http://www.excelforum.com/member.php...fo&userid=9656
    > View this thread: http://www.excelforum.com/showthread...hreadid=398466
    >




+ Reply to Thread

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