Results 1 to 3 of 3
  1. #1
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hiding columns in Excel (xl97 SR2)

    Hi, me again, the one who is always finding incompatibilities in VBA for xl97 and xl2000. I have code that works great in xl2000 to programmatically hide a set of rows and columns on worksheets. This same code fails in xl97. I've tried a few workarounds but so far none of my previously learned tricks is working. Here's a code snippet. The ranges to be hidden/unhidden are assigned named ranges.
    <pre> Set rng = Range("ha.CompB")
    rng.EntireColumn.Hidden = true
    </pre>

    The name "ha.CompB" is just a cell on a given worksheet.

    Thnx, Deb <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: hiding columns in Excel (xl97 SR2)

    Deb,

    I have tried the code you posted and it works as expected in XL97. Could you post some more of the code, as if you are getting errors it is a result of some other line(s) of code.

    Andrew C

  3. #3
    5 Star Lounger jujuraf's Avatar
    Join Date
    Jun 2001
    Location
    San Jose, California, USA
    Posts
    1,061
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: hiding columns in Excel (xl97 SR2)

    I got it working but I had to add an activate method (worksheet("blah").activate). If I create a simple, default workbook (3 sheets) it works great, but once you have a very large workbook with lots of stuff in it, that's when the x97 VBA gets weird. I've seen this on many occasions. I tried gradually removing things from my project and got it to the size where VBA is okay with the code.

    Today I had the problem with ActiveWindow.smallscroll not working in xl97 too. It worked fine in xl2000 and in a new, empty workbook in xl97 but not when I added it to my large worksheet_activate() events. If the activate event is small, it worked fine.

    Thanks for the help,
    Deb <img src=/S/bash.gif border=0 alt=bash width=35 height=39>

Posting Permissions

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