Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Spreadsheets (https://www.askmehelpdesk.com/forumdisplay.php?f=395)
-   -   Excel Macro Freeze Panes (https://www.askmehelpdesk.com/showthread.php?t=363611)

  • Jun 10, 2009, 06:54 PM
    adalton
    Excel Macro Freeze Panes
    When I record a macro to freeze panes it gives me this code:

    Rows("1:4").Select
    ActiveWindow.FreezePanes = True

    But when I put it into my macro it freezes a bunch of rows and even some columns. Is there another way to do this? It is selecting the rows its just not freezing the right ones.
  • Jun 10, 2009, 07:25 PM
    JBeaucaire

    What ONE cell do want to freeze by?

    If you select a cell in column A, it freezes all rows above but the whole sheet scrolls down in rows.

    If you select a cell in Row 1, it freezes columns to the left of the choice and scrolls the sheet across in columns.

    If you select anything else, it will freeze above and to the left of the cell chosen.

    So, what one cell are you going to select?

    Based on your example above, it appears to me you want to freeze the first 4 rows onscreen. If so, use this:
    Code:

    Rows("A5").Select
    ActiveWindow.FreezePanes = True


  • All times are GMT -7. The time now is 01:35 AM.