From the course: Office Scripts In Excel: Automating Tasks

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Challenge: AutoFit and freeze panes for all workbooks

Challenge: AutoFit and freeze panes for all workbooks - Microsoft Excel Tutorial

From the course: Office Scripts In Excel: Automating Tasks

Challenge: AutoFit and freeze panes for all workbooks

In this challenge, you'll put together some of the skills you've learned so far in the course. Start by navigating to the Challenge Files folder in the exercises for this video and open one of the files. I'll choose the Financial Budget Planning workbook. Begin by using the Record Actions feature to start recording a script. First, you'll autofit all columns to adjust their widths. Then you'll freeze the first row to keep it visible while scrolling. Once both those modifications are done, you can stop the recording. You'll head to Edit Code to review what was recorded and save your script with a name like Autofit and Freeze Rows. The goal for your challenge is to apply this script to all workbooks in the folder then see if you can develop a way to allow the user to specify how many rows to freeze in each worksheet, one, two, or so forth. To do this, you will create a variable inside a function main where the user can easily change the number of rows to freeze. If you need a refresher,…

Contents