Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Freeze Panes and ScreenUpdating conflict (Excel 2003)

    Hi,

    I have a workbook that runs a macro attached to the Workbook_Open event. The macro runs commands to standardize the layout 3 of worksheets containing lists. What it does is to select a worksheet, unfreeze panes, unfilter the list, select a cell and freeze panes at that location. Then it moves to the next sheet and does the same, and the same again on the third.

    The macro runs perfectly, but the moment I added the line: Application.ScreenUpdating = True (and False at the end of the code) the macro, when it gets to the line to select the cell (to freeze at) moves to the cell, but the screen DOES NOT. So the resulting "freeze panes" freezes at a entirely different location as the screen did not scroll to the active cell.

    I would like the ScreenUpdating to be there as it makes for a cleaner and faster Workbook_Open...but how can I get around the fact that it does not freeze at the correct positions on the three seperate sheets? (Without the ScreenUpdating....it works like a dream!)

    TIA
    Regards,
    Rudi

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Freeze Panes and ScreenUpdating conflict (Excel 2003)

    You could set ScreenUpdating to True immediately before the FreezePanes line, and to False again immediately after it.

  3. #3
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Freeze Panes and ScreenUpdating conflict (Excel 2003)

    I will do that...Tx.

    Although this will clean up the "flicker" quite a lot...it still seems to be a "jippo" method just to get around the problem. I am quite happy with your suggestion, but do you not know of any other solution to this screenupdating/freezing panes scenario? I know that there is a scroll method in VBA....I am going to see if that may not force the screen to move even though the updating is false?? (Hmmm...I wondewr if it will work....will get back on this)!
    Regards,
    Rudi

Posting Permissions

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