Gridlines & Freeze Panes Disappear in New Excel Window

  Рет қаралды 8,722

Excel Campus - Jon

Excel Campus - Jon

Күн бұрын

Sign up for our Excel webinar, times added weekly: www.excelcampus.com/blueprint...
In this video I explain how to fix the issue with Gridline and Freeze Panes settings not applying to New Windows in Excel. This solution uses a VBA macro to quickly create the new window, apply the settings, and put the windows in split screen view.
Download the Excel file that contains the macro: www.excelcampus.com/tips/new-...
The settings for the gridlines and freeze panes can be lost if you save the file in the new window. So the macro helps prevent this issue that can cause a lot of frustration and re-work.
The macro can be added to your Personal Macro Workbook (PMW). Checkout my video series on how to create your Personal Macro Workbook.
• The Personal Macro Wor...
In that playlist I also have a video on how to create macro buttons in the Ribbon and Quick Access Toolbar, so you can quickly run the macros from any open file. Here is a direct link to that video.
• How to Add Macro Butto...
You can also create a custom keyboard shortcut to run the macros. Here is a link to a video that explains how to set it up.
• How To Assign Keyboard...
The macro performs the following steps, which will save you a lot of time if you are using the New Window feature frequently.
1. Creates the New Window.
2. Loops through all sheets in the new window and applies all of the following settings from the original window: Gridlines, Freeze Panes, and Headings. The macro identifies the cell (row/column) that the freeze panes are applied to and applies it the same way to the new window.
3. Activates the original sheet in the original and new window. The sheets must be activated in the loop to apply the window level settings.
4. Arrange the windows in vertical side-by-side split screen view. This uses the Arrange method (Arrange All button).
5. Scroll to the active tab in the workbook so you can view it. The split screen can cause the active sheet tab to be out of view. So this prevents you from having to scroll to find it.
00:00 Introduction
00:11 Gridlines & Freeze Panes Disappear in a New Window
03:35 The New Window Macro
04:16 The New Window Macro VBA Code

Пікірлер: 31
@jordandankowich6018
@jordandankowich6018 Жыл бұрын
Awesome. I've automated a bunch of trivial stuff with my Personal Macro Workbook but a fix to this LOOOOOOONG-TERM annoyance was beyond my skill-set. Thankfully copy/pasting is well within my skillset :) Love this.
@football42241
@football42241 Жыл бұрын
This is fantastic. Freeze panes disappearing was such massive annoyance, and the few extra seconds to compute is 100% worth it. THANK YOU!
@ExcelCampus
@ExcelCampus Жыл бұрын
You're welcome, DukeNukem421! 😀
@RonLeedy
@RonLeedy 5 жыл бұрын
Thanks for the great video. I like the "bug" at the window level settings. Sometimes I like to set the gridlines on the second window to help review the data but want to keep the end user experience on the original window.
@ExcelCampus
@ExcelCampus 5 жыл бұрын
Thanks Ron! It's great to hear you have a use for this "bug". :-)
@roderickmose4691
@roderickmose4691 5 жыл бұрын
Both videos are great John! Love the macro features. Everyone I've introduced the New Window feature to always find it useful for work tasks. Awesome video.
@ExcelCampus
@ExcelCampus 5 жыл бұрын
Thanks again Roderick! :-)
@wayneedmondson1065
@wayneedmondson1065 5 жыл бұрын
Hi Jon.. awesome.. when I watch the first video, I was thinking.. hey.. should automate this with VBA. You've done it for us. Thanks for that and the great tips and insights on the use of the New Window feature.. now enhanced to work more efficiently with your macro addition. Thumbs up!
@ExcelCampus
@ExcelCampus 5 жыл бұрын
Thank you Wayne! I'm always looking for things to automate with VBA. I'm addicted... :-) Happy to hear I'm not alone. Haha! 😀
@thrash55555
@thrash55555 Жыл бұрын
You're the man
@aquayum72
@aquayum72 5 жыл бұрын
Top tip John, I always had issues with this problem. Will be implementing the macro and sharing with others. Thanks again!
@irislu7070
@irislu7070 4 жыл бұрын
This video saves my day! Thank you!
@rjbjajjjmj1
@rjbjajjjmj1 5 жыл бұрын
As usual, Jon - nice work! Thanks.
@ExcelCampus
@ExcelCampus 5 жыл бұрын
Thanks Bob! :-)
@johnborg6005
@johnborg6005 5 жыл бұрын
Thanks John. Very Very Helpful :)
@RussellHonnor
@RussellHonnor 2 жыл бұрын
Awesome Thanks !
@kailash680
@kailash680 5 жыл бұрын
The Macro might work in English Excel versions, but not in mine. Because the window names are different. e.g. MyWorkbook 1:1 MyWorkbook 1:2 Så one has to change the Macro like this: Option Explicit Sub New_Window_Preserve_Settings() 'Create a new window and apply the grid line settings 'for each sheet. Dim ws As Worksheet Dim i As Long Dim iWinCnt As Long Dim bGrid As Boolean Dim bPanes As Boolean Dim bHeadings As Boolean Dim iSplitRow As Long Dim iSplitCol As Long Dim iActive As Long Application.ScreenUpdating = False 'Store the active sheet iActive = ActiveSheet.Index 'Create new window ActiveWindow.NewWindow iWinCnt = ActiveWorkbook.Windows.Count 'Loop through worksheets of original workbook 'and apply grid line settings to each sheet. For Each ws In ActiveWorkbook.Worksheets Windows(ActiveWorkbook.Name & ":1").Activate ws.Activate 'Store the properties bGrid = ActiveWindow.DisplayGridlines bHeadings = ActiveWindow.DisplayHeadings 'Get freeze panes bPanes = ActiveWindow.FreezePanes If bPanes Then iSplitRow = ActiveWindow.SplitRow iSplitCol = ActiveWindow.SplitColumn End If 'Activate the new window and sheet in loop Windows(ActiveWorkbook.Name & ":" & iWinCnt).Activate Worksheets(ws.Index).Activate 'Set properties With ActiveWindow .DisplayGridlines = bGrid .DisplayHeadings = bHeadings If bPanes Then .SplitRow = iSplitRow .SplitColumn = iSplitCol .FreezePanes = True End If End With Next ws 'Activate original active sheet for the new window Worksheets(iActive).Activate 'Activate the original active sheet for the original window Windows(ActiveWorkbook.Name & ":1").Activate Worksheets(iActive).Activate 'Split Screen View (optional) 'The following section can be commented out if you don't want split screen. 'Turn screen updating on for split screen Application.ScreenUpdating = True For i = iWinCnt To 1 Step -1 Windows(ActiveWorkbook.Name & ":" & i).Activate Next i 'Split view side-by-side vertical ActiveWorkbook.Windows.Arrange ArrangeStyle:=xlVertical 'Scroll to active tab in original window ActiveWindow.ScrollWorkbookTabs Position:=xlFirst ActiveWindow.ScrollWorkbookTabs Sheets:=iActive 'Scroll to active tab in new window Windows(ActiveWorkbook.Name & ":" & iWinCnt).Activate DoEvents ActiveWindow.ScrollWorkbookTabs Position:=xlFirst ActiveWindow.ScrollWorkbookTabs Sheets:=iActive End Sub Sub Close_Additional_Windows() 'Close additional windows and maximize original Dim i As Long If ActiveWorkbook.Windows.Count > 1 Then For i = ActiveWorkbook.Windows.Count To 2 Step -1 Windows(ActiveWorkbook.Name & ":" & i).Close Next i End If Windows(ActiveWorkbook.Name).WindowState = xlMaximized End Sub
@ExcelCampus
@ExcelCampus 5 жыл бұрын
Hi Kailash, Thank you for letting me know. It looks like the "-" as the separator character was recently added to Office 365. Most versions of Excel still use the colon ":". I updated the macro to accommodate both styles using the Instr function to check for the colon, and then an If statement to set the separator character. Here is the code. If InStr(":", ActiveWorkbook.Name) > 0 Then sSep = ":" Else sSep = " - " End If The blog post and sample file contain the full macro. www.excelcampus.com/tips/new-window-gridlines-freeze-panes This should cover you now and in the future if you receive the new updated version. I hope that helps. Thanks again and have a nice day! :-)
@kayleecriswell3469
@kayleecriswell3469 5 жыл бұрын
This is awesome and working thanks to the comments. Is there something in this code I can change that would cause the new window to open a sheet two, rather than the sheet I am viewing?
@stanleyrunyon
@stanleyrunyon 5 жыл бұрын
As always, Jon, you have shared some cool things. I haven't noticed these "bugs" mentioned about the New Window feature because I don't use the feature that often. Other than making it easier to enter arguments into a formula that call up references from other workbook sheets, what is the purpose of using the New Window feature? I could see a use for it if we could make independent changes in the new windows.
@ExcelCampus
@ExcelCampus 5 жыл бұрын
Hi Stanley, Great question! Any changes in made in the new window are automatically synced with the other windows. So the changes are not independent. I hope that makes sense. The new window feature is great for comparing lists, tying out numbers between summary reports and data source sheets, writing or checking formulas based on ranges in another sheet, copying/pasting data between sheets, and any other task you're doing where you are flipping back and forth between sheets frequently. I hope that helps. Thanks!:
@YanisKyr
@YanisKyr 5 жыл бұрын
Great video Jon! Link to the file seems to be missing though :)
@ExcelCampus
@ExcelCampus 5 жыл бұрын
Thanks for letting me know Yanis. I just added it in the description. Here is the link: www.excelcampus.com/tips/new-window-gridlines-freeze-panes/
@jeroenvandervelden7318
@jeroenvandervelden7318 3 жыл бұрын
In my company, we use Excel to work on a .xml file and we use freeze pane allot. When me or my colleagues are done, we save the file as a new version and all freeze panes are lost. Is there a way to save those freeze panes? In our case, the freeze is always on the exact same lines. The document has multiple tabs. Your help is much appreciated!
@tracyrowland1080
@tracyrowland1080 5 жыл бұрын
Great video! Maybe I missed it, but I accidentally saved version 2 and now when I open the file they both open. I know now what not to do, e.g. save the version 2, but how do I keep that from happening on this particular file?
@ExcelCampus
@ExcelCampus 5 жыл бұрын
Hi Tracy, Great question! There is a way to prevent this. I'll first explain the behavior. When you click save on window #2, then close both windows, the file will open with two windows the next time you open it. This can be good if you always want to have two windows open when you open the file. However, you will still suffer from the same window level settings issues. To prevent this you must click the save button on window #1 before closing the file. If you click save on window #2 then close both windows, they will both re-open next time. You can still click save on window #2 when you are working in the file. Just make sure to click save on window #1 before closing the file completely. The Close New Macro window I shared in the video will also help prevent this because it closes all additional windows. You will then need to save the original before closing if you made any changes. You could also add a line of code to the macro to save the workbook. ActiveWorbook.Save I hope that helps. Thanks again and have a nice day! :-)
@tracyrowland1080
@tracyrowland1080 5 жыл бұрын
Thank you Jon. I wasn’t clear in my ask. I already accidentally saved window #2 and they are both opening. What I want is to get rid of the 2nd window. I understand now how to prevent it from occurring going forward but am not sure how to correct this file. Should I just save as a new version?
@roderickmose4691
@roderickmose4691 5 жыл бұрын
Can't download the file. Link not available
@ExcelCampus
@ExcelCampus 5 жыл бұрын
Hi Roderick, I'm sorry about that. Thank you for letting me know! I just added the link in the description. Here it is: www.excelcampus.com/tips/new-window-gridlines-freeze-panes/
@YanisKyr
@YanisKyr 5 жыл бұрын
Hi Jon, in my Excel 2016 I'm getting a Runtime error 9 (subscript out of range) here "Windows(ActiveWorkbook.Name & sSep & "1").Activate". This happens with all files I've tried. Any ideas what it could be?
@kailash680
@kailash680 5 жыл бұрын
Missing File is on his website: www.excelcampus.com/tips/new-window-gridlines-freeze-panes/
Convert Text to Time Values with Text Functions (Data Cleansing Part 1)
15:46
5 Tips for Working with Formulas in Excel
9:23
Excel Campus - Jon
Рет қаралды 25 М.
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 57 МЛН
I've Stopped Recommending This Excel Feature
8:21
Excel Campus - Jon
Рет қаралды 12 М.
Hide Show Ribbon in Excel Using VBA
4:57
Dinesh Kumar Takyar
Рет қаралды 13 М.
How To Prevent Vlookup Errors When Inserting Or Deleting Columns
7:00
Excel Campus - Jon
Рет қаралды 39 М.
The Best Excel Table Of Contents That Automatically Updates
6:41
Excel Campus - Jon
Рет қаралды 48 М.
Convert Text to Time Values with SUMPRODUCT (Data Cleansing Part 2)
14:22
Excel Campus - Jon
Рет қаралды 6 М.
Excel Macros & VBA - Tutorial for Beginners
50:20
Kevin Stratvert
Рет қаралды 1,1 МЛН
Dynamic Array Functions Are The Best New Excel Feature!
9:07
Excel Campus - Jon
Рет қаралды 85 М.
Excel Shortcuts You SHOULD Know!
8:48
Leila Gharani
Рет қаралды 2,1 МЛН
Excel VBA Objects: Events and Event Procedures
7:58
Excel Macro Mania
Рет қаралды 5 М.
How To Use Index Match As An Alternative To Vlookup
19:28
Excel Campus - Jon
Рет қаралды 1,5 МЛН