+ Reply to Thread
Results 1 to 7 of 7

Unable to set the Hidden property of the Range class

  1. #1
    Registered User
    Join Date
    02-07-2007
    Posts
    4

    Unable to set the Hidden property of the Range class

    I am trying to Hide columns but keep getting this error.

    Run-time error ‘1004’
    Unable to set the Hidden property of the Range class

    Sub COLLAPSED()
    '
    ' COLLAPSED Macro
    ' Macro recorded 1/15/2007 by Margie Wong - x4346
    '

    Cells.Select
    Selection.EntireColumn.Hidden = False
    Range("A7").Select
    Do Until ActiveCell = "End"
    If ActiveCell = "HIDE" Then
    Selection.EntireColumn.Hidden = True
    End If
    ActiveCell.Offset(0, 1).Select
    Loop

    Columns("ha:ha").Select
    Selection.EntireColumn.Hidden = True
    Range("A6").Select
    End Sub

    Please help!

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Not a VBA expert but would this help

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    02-07-2007
    Posts
    4
    Hi VBA Noob,

    That didn't help. Any more suggestions please. I can't even do a manual hide. Keep getting this error msg. "Cannot shift objects off sheet." I have tried to delete columns but get error msg “Microsoft Excel has encountered a problem and needs to close.”

    PLEASE HELP!

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Just winging it here, but does this MS article make any sense?

    http://support.microsoft.com/kb/211769

    It refers to objects (including comments) that are set --by default-- to move and size with cells.

  5. #5
    Registered User
    Join Date
    02-07-2007
    Posts
    4
    Hi, still no luck!

  6. #6
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Would you be able to post a copy of the spreadsheet for us to look at?

  7. #7
    Registered User
    Join Date
    02-07-2007
    Posts
    4
    Hi Paul,

    I want to thank you very much for the link you provided. I did create the macro indicated from Method 2, and a "MIRACLE" happened. I was able to HIDE all the columns I wanted.

    I had tried so many times to delete columns, rewrite the macro, tried to manually hide the columns ... nothing helped ... until I added that macro from the link.

    Your assistance is greatly appreciated!!!

    Thanks again!

+ 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