Smooth Scrolling in Excel for Windows

We’ve heard from many of you that it can be difficult to scroll through a worksheet with large cells and view all the data. Excel automatically snapped to your top-left cell when you scrolled.  Though you might think this is an easy fix, simply requiring the alteration of a few lines of code, there’s actually a lot more to it. We discovered that this change has many effects on Excel, including freezing panes as well as resizing rows and cutting and pasting. It also affects cell styles, comments, filtering, cell styling, filling, and filtering.

Short video showing an Excel sheet that scrolls and stops partway through row 2, then scrolls to show row 1. The bold text in row 2 says "We're happy to anounce New in Excel for Windows: Smooth Scrolling".Short video showing an Excel spreadsheet that scrolls and stops halfway through row 2. Then, it scrolls to row 1. Row 2 has bold text that reads: “We’re happy announce New in Excel For Windows: Smooth Scrolling”.

How it works

When you’re scrolling in a sheet with very large cells, the way Excel for Windows snapped to the grid made it hard to view your data. Many of you requested that we improve the way this works, and that’s just what we’ve done. We fixed the issue by making the scrolling much smoother—there are 2 parts to this update.

  • First, it’s smoother during the scroll when using either the mouse wheel* or the scrollbars (touch screen and touch pad already scrolled smoothly).
  • Second, and most importantly: You can stop scrolling half-way through a row, column, or row., and Excel won’t force you to go any further than you want.
* Depending on the mouse or touch pad you’re using, you may not be able to scroll one pixel at a time. If you don’t have a “precision” mouse or touch pad, each movement will be based on the height of one line of text. If Windows allows you to move 1 line per click of the scrollwheel, it will move by each line of text and not by 1 row in your worksheet.

Things to Try

  1. Increase the height of rows in your spreadsheet. Scroll using your mouse wheel, touch pad, or keyboard to see if you can stop at the end of a row without snapping to its top.
  2. Drag the scrollbar to see how precise you can scroll and where you can stop.

Want to learn more?

Excel will scroll more smoothly, that’s all. But we wanted to share more details about this improvement. It gives a fascinating glimpse at the complexities of Excel, which has been around for decades. Many who’ve asked for Excel to stop snapping when you’re trying to scroll just a little have also asked why this wasn’t done a long time ago.  It should be easy to remove a few lines code that causes the sheet’s snapping. Right? It would be so simple. While it may seem easy to smooth things out and not snap, there are some side effects. We discovered that Excel was affected by this change.

There were two main issues that we found. The first was the inability to snap to the edges and the second was the inability of scrolling smoothly. One set of issues dealt with the positioning of objects on the sheet, and the other set of issues related to how objects are displayed while you’re scrolling.

To understand why there were issues with positioning objects on the sheet, it’s helpful to know that the position of the sheet (which cell is in the top-left corner of the visible area) is fundamental to just about everything that gets displayed in Excel.  Excel calculates the position at which a chart should be displayed, based on its distance from the top-left cell. Calculations such as this were designed with the assumption that the sheet would always be on the edge a row or column. Because smooth scrolling allows for the sheet to be positioned halfway through rows and columns, these calculations needed to be updated in order to prevent your chart from appearing in the wrong spot. There are calculations that can be used to determine the position of objects and screen elements while scrolling. Many of these calculations assumed Excel would always be neatly snapped to cell edges. To make this a smoother experience, we needed to develop new methods to calculate these positions in an easier way.

We also discovered issues with the location of the mouse and touch points within the sheet. There are calculations to determine where you’re clicking or pointing in Excel. These calculations assume that the sheet would be snapped. This could mean that your click might not reach what you expected. You might click on one cell, but a new cell would be selected.

Screen shot of a table in Excel showing the mouse is clicking on cell E5, but cell G5 becomes selected, due to an offset from column B being scrolled part way out of view, causing an “offset” which was not possible when Excel always snapped to the edge of a column.Screen shot of a table in Excel showing the mouse is clicking on cell E5, but cell G5 becomes selected, due to an offset from column B being scrolled part way out of view, causing an “offset” which was not possible when Excel always snapped to the edge of a column.

The same thing applies to your touch screen. Excel calculates where you touched and assumes that the sheet will be snapped. One issue we found was that if we scrolled partway through a row and tried to draw on the sheet, there would be a gap near the bottom of the sheet where we couldn’t draw anything. The gap was exactly the height of the section of the top row that was hidden from view.

This image shows that since row 1 is scrolled partway out of view, the “offset” caused a drawing problem near the bottom of the sheet. Drawing near the bottom of the sheet stopped working in an area the same height as the amount of row 1 which is out of view.This image shows that since row 1 is scrolled partway out of view, the “offset” caused a drawing problem near the bottom of the sheet. Drawing in the area near the bottom of a sheet was not possible due to the fact that it was the same height as row 1, which is out of sight.

These are just some examples. However, the graphic below shows the broad-ranging effects of this change. It highlights all the Excel functions that could be affected by the sheet not being held straight to the edge.

A word cloud diagram listing various aspects of Excel in different font sizes, colors, and angles. The largest words are "freezepanes", "scrollbar", "RTLSheet", "PLV", "datavalidation", "editcell", and comments. There are other smaller words scattered around the larger words.A word cloud diagram showing Excel’s various aspects in different font sizes, colors, angles. The largest words are “freezepanes”, RTLSheet”, scrollbar”, “RTLSheet”, RTLSheet”, PLV”, datavalidation, “editcell”, and “comments”. There are many other smaller words that can be found around the larger words.

The diagram below shows that with smooth scrolling, the sheet can be scrolled partway through a row and column, which creates an “offset” distance both horizontally and vertically. This offset was impossible because the sheet was always snapped to one edge of a row or column. The calculations of the screen’s position were straightforward. Now the calculations need to deal with the offset, so it’s significantly more complicated.

Sreen shot of a few rows and columns in Excel with column A and row 1 partially scrolled out of view to the top of the sheet. A dotted rectangle indicates the borders of the part of A1 that's out of view.Sreen shot showing Excel columns and rows with column A and row 1 partially hidden from view. A dotted rectangle signifies the borders of the A1 area that isn’t in view.

We found in early testing that some things just didn’t look or work as expected, so we realized this was not going to be a simple or straightforward change. Excel’s entire functionality could be affected, as indicated by the graphic. Therefore, we had to carefully examine each section of the app. As you might expect, fixing a problem can sometimes have unintended consequences. Sometimes we had no choice but to take a step back in order to find a solution that would not create more problems.

Another consideration is the variety of different ways that you can scroll in Excel – mouse wheel, touch pad, touch screen, scroll bar drag, scroll bar buttons, selection drag, and more. These changes may have an impact on each scroll method. We spent time optimizing the code for each scrolling mode to reduce the differences. This means that a problem with one scrolling method could be fixed for all. Although it was a worthwhile effort, it delayed Smooth Scrolling’s release.

Scrolling is an integral part of Excel. For this reason, we had to be very careful at every step of the way to ensure that while we’re making a big improvement, we don’t miss something important. It was a classic “peeling the onion” story in software development – the more layers that you uncover, the more you find. Now we’ve peeled all the layers, we expect it to be smooth scrolling into the future.

Available

This feature is available for Insiders on Windows with Beta Channel, Current Channel Preview with Version 2109 (Build 1433.20000) or later. To ensure that things work properly, features are gradually enabled over time.

Leave a Reply

Your email address will not be published. Required fields are marked *