none
Freeze Panes problem in Excel 2010 RRS feed

  • Question

  • Example... If cell B2 is selected... then scroll down and right leaving the selected cell at B2 but no longer visible on the screen... Now slect View> FreezePanes.

    The panes are frozen at the cell at the dead centre of the visible screen instead of at the selected cell B2.

    This would not occur under normal circumstances while working directly on the worksheet because we wouldn't usually scroll away from the selected cell. It came to light when it happened in a VBA routine.

    My procedure moves data from the front sheet to new sheets, and deletes the rows from the first sheet leaving some data on the front sheet.

    The procedure then cycles through all the sheets and at each sheet selects cell B2 and sets the FreezePanes.

    It's fine for all the new sheets, but the front sheet freezes the panes at some weirdly odd place well away from B2, despite the code saying...

    Range("A3").Select
    ActiveWindow.FreezePanes = True

    So I checked it out on a blank worksheet and there it is... frozen at the cell in the centre of the screen.

    I still haven't solved how to make my VBA routine apply the freeze at B2 on the front sheet.

    Thanks

    Friday, April 5, 2019 4:42 PM

All replies

  • This is clearly a bug. You can work around it by using Application.GoTo:

        Application.GoTo Range("B2"), True
        ActiveWindow.FreezePanes = True


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Friday, April 5, 2019 6:12 PM