+ Reply to Thread
Results 1 to 10 of 10

Custom Freez Pane

  1. #1
    Forum Contributor
    Join Date
    07-25-2012
    Location
    Pakistan
    MS-Off Ver
    Office 365 for MAC
    Posts
    191

    Custom Freez Pane

    Hi All

    I have a long sheet of excel, From A to AR and Row 1 to 250.

    1. Top two row is heading.
    2. Coloumn A to G is heading too.

    I want whole two Row and colomn A to G should Freez and whole sheet unfreez.
    May be i elaborate my self , if not please ask.....

    Regards and thanks in advance.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Custom Freez Pane

    Hi, waqarqrl,

    maybe use this macro recorder code for the action on the active sheet:

    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,953

    Re: Custom Freez Pane

    Put the cursor in cell H3, then select freeze panes from View tab on the ribbon, then select Freeze Panes
    Ben Van Johnson

  4. #4
    Forum Contributor
    Join Date
    07-25-2012
    Location
    Pakistan
    MS-Off Ver
    Office 365 for MAC
    Posts
    191

    Re: Custom Freez Pane

    Thanks alot HAHOBE and Protonleach

    To HAHOBE sir can u please tell me the full code as i am very week in cooding thanks in advance.

    To Protonleach Sir i know it freez the pane but when i put cursor on H3 and click freez pane it will not freez from A1 to AR 2.

    I attach file for better understanding, the colomn and row which highlighted in Yellow should only be Freez.

    Regards and thanks
    Attached Files Attached Files

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Custom Freez Pane

    Hi, waqarqrl,

    your workbook does not correspond to your opeing post (....colomn A to G should Freez, in workbook Columns A to H are coloured yellow).

    The code I supplied is the full code which runs fine in any version of Windows Excel from 97 to 2010 on the active sheet except for one change for your workbook where Range should be I3 instead of H3 (I posted this version due to the ease of understanding: just enter the cell and call the ActiveWindow.FreezePanes = True line).

    Ciao,
    Holger

  6. #6
    Forum Contributor
    Join Date
    07-25-2012
    Location
    Pakistan
    MS-Off Ver
    Office 365 for MAC
    Posts
    191

    Re: Custom Freez Pane

    Thanks alot HAHABE

    earlier i mention A to G then A to H does not matter.
    sir if u feel like post a workbook thats easy for me...........

    REgards and thanks alot again.

  7. #7
    Forum Contributor
    Join Date
    07-25-2012
    Location
    Pakistan
    MS-Off Ver
    Office 365 for MAC
    Posts
    191

    Re: Custom Freez Pane

    Sir HAHOBE

    i am waiting for your favorable response
    REgards

  8. #8
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Custom Freez Pane

    Hi, waqarqrl,

    youīre not able to insert a Module into a workbook and donīt know how to get the code sniplet into a procedure?

    Sheet1 is your sample, macro is assigned to a shortcut (CTRL + Shift + z), in Sheet2 you just need to right click in a cell to freeze pane there.

    Maybe you should attach a macro-enabled workbook next time you want some VBA-Code inserted...

    Ciao,
    Holger
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    07-25-2012
    Location
    Pakistan
    MS-Off Ver
    Office 365 for MAC
    Posts
    191

    Re: Custom Freez Pane

    Thanks alot Hahobe
    This is exactly what i want .........and i apologized if u feel any inconvienance .....

    Moreover if i want to change the freez range from I3 to J5 what should i do......i try my self in your code but nothing happen....
    More of your guide need.

    REgards

  10. #10
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Custom Freez Pane

    Hi, waqarqrl,

    and i apologized if u feel any inconvienance
    You need not apologize - itīs for me and the explanations to be given (not just the line of code but some words for that as well).

    If you have set the FreezePanes to a sheet and you want to alter the position you will first need to disable this setting, then set a new cell and run the command again. The example how to proceed may be found behind the Sheet2 but for the normal code it may look something like this:
    Please Login or Register  to view this content.
    although I would split up the code into 2 procedures like
    Please Login or Register  to view this content.
    so that the UnFreeze may be called on itīs own.

    Ciao,
    Holger

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1