Stuart’s MATLAB Videos

Watch and Learn

Creating a Function to Format a Spreadsheet

I often export to Excel to share results with others. In doing so I control the format of the output with a template with column widths and heading colors that I have talked about in previous videos (saving to a template, replicating a worksheet template). However, if I change the number of columns in my data, I need to change the template, which is annoying.

So here I try to make a function, where I can specify the column widths and colors as parameters, and therefore change it dynamically to match the columns in my table. It requires interacting with Excel’s object model, which I find difficult and I need to frequently refer to VBA (Visual Basic for Applications ) documentation online.

Features covered in this code-along style video include:

Video Player is loading.
Current Time 0:00
Duration 33:35
Loaded: 0.50%
Stream Type LIVE
Remaining Time 33:35
 
1x
  • Chapters
  • descriptions off, selected
  • captions off, selected
  • en (Main), selected

    Play the video in full screen mode for a better viewing experience. 

    |
    • print

    Comments

    To leave a comment, please click here to sign in to your MathWorks Account or create a new one.

    Loading...
    Go to top of page