+ Reply to Thread
Results 1 to 3 of 3

VBA and freeze pan

  1. #1
    Registered User
    Join Date
    04-22-2020
    Location
    London
    MS-Off Ver
    16
    Posts
    5

    VBA and freeze pan

    Hello,
    I have created a macro that splits clients according to their account manager. For ease of use, I have added a freeze pan on cell C6. However, the freeze appears anywhere on the workbook, and I am not sure why.

    ActiveWindow.FreezePanes = False
    Range("C6").Select
    ActiveWindow.FreezePanes = True
    ActiveWorkbook.Save
    ActiveWindow.Close

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,087

    Re: VBA and freeze pan

    I suspect you should be referring to the ActiveSheet rather than the ActiveWindow (not tested).


    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional.)
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,087

    Re: VBA and freeze pan

    I think I may be wrong, but pretty sure you need to select the sheet first.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to freeze data label information when you freeze a chart
    By max138 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-10-2018, 08:14 AM
  2. Freeze Panes - Can I freeze a specific set of cells?
    By Rosco88 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-15-2013, 09:17 AM
  3. Freeze Panes - Freeze Tabs
    By samprince in forum Excel General
    Replies: 1
    Last Post: 01-23-2007, 05:16 PM
  4. Replies: 3
    Last Post: 11-27-2006, 05:24 PM
  5. [SOLVED] Excel 2003 freeze panes won't freeze top row only
    By macbone2002 in forum Excel General
    Replies: 1
    Last Post: 05-31-2006, 11:10 AM
  6. Freeze Panes-When freeze panes is employed it leave a black line
    By peter.thompson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2006, 01:40 AM
  7. [SOLVED] Freeze Panes-can you freeze more than one column
    By rexmann in forum Excel General
    Replies: 4
    Last Post: 06-09-2005, 11:05 AM

Tags for this Thread

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