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.
Solution: AutoFit and freeze panes for all workbooks - Microsoft Excel Tutorial
From the course: Office Scripts In Excel: Automating Tasks
Solution: AutoFit and freeze panes for all workbooks
Welcome back. I hope you enjoy tackling this challenge. Let's dive into the solution. First, let's head into the Financial Budget Planning workbook to autofit the columns and freeze panes using Record Actions. When I am done recording my steps, I will click Stop. Let's give the script a name, something like Autofit and Freeze Panes, enter, and let's revisit this script. So if I hit Edit Code, the modification we need to make is to add a second variable. Let's call it numRows. This will be a number data type. Next, we'll head down to the last line in our script where the value, 1, is currently hard coded. I'm going to replace that with the numRows variable, allowing us to dynamically set the number of rows to freeze. Let's save the script and run it to test. We can set our number of rows to another number like two. And if I run the script, you will see that now it is frozen to the second row. Great work. You can find this script in the exercise files under autofit-freeze-panes.txt…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Debugging Office Scripts with console.log()4m 2s
-
(Locked)
Collaborating with Office Scripts2m 41s
-
(Locked)
Integrating Office Scripts with Power Automate4m 42s
-
(Locked)
Automating multiple workbooks with Power Automate and Office Scripts6m 5s
-
(Locked)
Challenge: AutoFit and freeze panes for all workbooks1m 26s
-
(Locked)
Solution: AutoFit and freeze panes for all workbooks3m 13s
-
(Locked)
-