Result: everyone gets what they want and Cindy's boss is happy. For example, if Cindy's workbook nemesis is someone higher up, Cindy could write the macro to provide that user with the specific layout they want. Instead of Exit Sub, the macro could take some other action. Replace "Cindy" with her actual User Name in Microsoft Office. If Application.UserName "Cindy") Then Exit Sub If it is Cindy, go ahead and do Cindy's formatting. Simply include a test in the Workbook_Open() macro to determine whether Cindy is opening the workbook. This is even more likely if Cindy is not the main user. If Cindy creates a Private Sub Workbook_Open() macro that changes the workbook appearance every time the workbook is opened, she may inadvertently start an office war over the "proper" appearance of the workbook.
Here's something that may be helpful if Cindy's problem is caused by multiple people using the same workbook. That way you could use the macro to set similar panes in any worksheet, with the click of a button.
HOW TO FREEZE MULTIPLE PANES IN EXCEL 365 CODE
You could also, if desired, change the code to a "regular" macro that could be assigned to a shortcut key or the Quick Access Toolbar. This macro would be added to the ThisWorkbook module, and you'll need to change the cell reference (D4) and worksheet name (Sheet1) to reflect where you want the panes set. The other thing you could try is to create your own macro that sets the panes as you want them to appear. You should then be able to load the custom view at a later time and have the pane settings be present (along with many other settings) so that you can continue working with the workbook. One is to simply save a custom view of your worksheet, with the panes in place. There are two other things you can do, if you desire. In that case, it could be that the workbook is becoming corrupted (for some reason) and you may need to work on getting your data into a different workbook. If the panes are still there, then this is a good sign that the problem is with the other workbook only. Put some test data in it, freeze the panes, and then save it. If none of those ring a bell with you, try starting with a brand new, blank workbook. Are filters being used in the workbook? If you apply filters, then set panes, and finally remove filters, the panes may also go away.Some users report an oddity where pane settings may not save properly in shared workbooks. Check if the workbook is being shared with others.
HOW TO FREEZE MULTIPLE PANES IN EXCEL 365 WINDOWS
Is the workbook, when open, being worked with using multiple windows? If so, and one of the windows doesn't use panes, the settings in the last-closed window are those that will "stick" in the workbook.(Save the file in XLS or XLSM format to see if that fixes the problem.) Other formats don't necessarily hold on to some settings, such as panes. See if the workbook is actually being saved in a non-Excel format, such as CSV or HTML.You might try looking for the text "FreezePanes" in the macros.) Check to see if the workbook has a macro that runs automatically when starting that removes the panes.See if someone else is updating or using the workbook and, while doing so, removing the panes.If that is apparently not happening for you, there are a few things you can check: The default behavior of the latest versions of Excel is that your pane settings should be persistent, just as Cindy remembers in older versions of Excel. She wants to save the pane settings with the workbook so they persist from one usage to another. Cindy doesn't think it used to be this way in older versions of Excel and wonders if there is some setting she needs to make or wonders, perhaps, if Excel has changed how it handles panes. Each time she opens the workbook, she needs to reset the panes. If Cindy freezes panes in a worksheet and then saves the workbook, the next time she opens that workbook the previously frozen panes no longer appear.