Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cannot hide columns (EXCEL 97/2000)

    Have this code:

    [Range_hor].EntireColumn.Hidden = False
    '
    For Each c In [Range_hor]
    If c.Value = "xxx" Then c.EntireColumn.Hidden = True
    Next

    (The sheet has some cells with comments attached) This has always worked fine. Recently I added even more spare-columns (which are filled with "xxx" as placeholder). Now when I run the code (or try to delete a column manually) somewhere half way I get an error indicating: "Cannot shift object off sheet".

    Normally I know why this happens: if e.g. there is no space anymore to display a comment to the right if one deletes all columns there. In this case I'm puzzled as to the right of my matrix: in columns FJ all the way to column IV there is nothing!! (I even re-deleted them all just to make sure)...

    What's going on and how can I prevent?? Is there a max # of filled columns one can only delete???

    Erik Jan

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cannot hide columns (EXCEL 97/2000)

    I seem te recall this having something to do with the properties of the comment: Whether or not they are set to Move and size with cells. Open a comment, rightclick its border and choose format comment. Then find the tab that has this option. Try the variations there...
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Cannot hide columns (EXCEL 97/2000)

    This might help. It discusses this eror message:
    http://support.microsoft.com/default.aspx?...kb;en-us;170081

    Steve

  4. #4
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cannot hide columns (EXCEL 97/2000)

    Believe that did the trick! It's solved now, thanks (again!)!!

    EJ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •