How to set Excel text font color with VBA?

In this tutorial we’ll learn how to use Visual Basic for Applications (VBA) to modify text size and style in an Excel cell based on the cell content. This tutorial apply for Excel 365, 2021, 2019 and 2016. Preliminaries If you are new to Excel VBA development, I’ll recommend that before going through the tutorial … Read more

How to set an Excel cell color according to a condition with VBA?

Applies to: Microsoft Excel 365, 2021, 2019, 2016. In today’s VBA for Excel Automation tutorial we’ll learn about how we can programmatically change the color of a cell based on the cell value. We can use this technique when developing a dashboard spreadsheet for example. Step #1: Prepare your spreadsheet If you are not yet … Read more

How to set an Excel spreadsheet column width with VBA?

Updated: August 2021; Works on Excel 365, 2019, 2016. In today’s Excel automation tutorial we will learn how to quickly change the width of a worksheet column as needed – but programmatically using VBA (Visual Basic for Applications). Prerequisites In order to write VBA code, you’ll need to first and foremost, ensure that your developer … Read more

How to make a Macro in Microsoft Visio?

Here’s a question from Danny: I have recently started using Microsoft Visio to make use of diagrams, layouts, and charts. I understood that i can improve my productivity by automating much of the common work across different diagram / drawing files by using Office Macros. As i am pretty new to VBA development, i would … Read more

How to work with Message and Input Boxes in PowerPoint VBA?

Going through the comments, i have seen a couple of reader questions on how to work with Visual Basic Input and Message boxes in PowerPoint. In this tutorial we’ll provide a very basic foundational knowledge to help you use those capabilities when automating your presentation creation. Setting up the Developer Tab First off, we’ll need … Read more

How to subset a dataframe by one or multiple columns?

When trying to make sense of a large DataFrame in Pandas, you might need to subset it by columns and rows. In this tutorial we’ll show the most prevalent use cases of column partitioning your DataFrame. Create an example DataFrame We’ll start by setting up our example DataFrame, which we’ll do by running the following … Read more

How to create and insert shapes in PowerPoint with VBA?

Couple days ago, i wanted to automate the rather mundane task of creating some PowerPoint slides. When automating PowerPoint you typically work with the Slides and Shapes collection. Slides is rather self explanatory, and shapes is pretty much everything else including text boxes, action buttons, media objects, labels, pictures, callouts, flowcharts and so on and … Read more

How to create and add slides to PowerPoint presentations with VBA?

A couple days ago, a reader asked about there is a way to automate creation of PowerPoint presentations from scratch and then quickly add slides to that existing presentation. I though that script might be highly in the list of the most useful PowerPoint Macros.  As we indicated in the past, PowerPoint doesn’t include a … Read more