Ultimate Guide: VBA for Charts & Graphs in Excel (100+ examples)

VBA Code Snippets

Charts and graphs are one of the best features of Excel; they are very flexible and can be used to make some very advanced visualization. However, this flexibility means there are hundreds of different options. We can create exactly the visualization we want but it can be time-consuming to apply. When we want to apply those hundreds … Read more

How to fix “Microsoft has blocked macros” (2 simple ways)

You are probably here because you’ve seen a warning message: Microsoft has blocked macros from running because the source of this file is untrusted. This post provides the background to this message and the steps you should take to enable the file. During 2022, Microsoft introduced new security into the Windows version of Microsoft Excel … Read more

VBA Tables and ListObjects

VBA Code Snippets

Tables are one of the most powerful features of Excel.  Controlling them using VBA provides a way to automate that power, which generates a double benefit 🙂 Excel likes to store data within tables.  The basic structural rules, such as (a) headings must be unique (b) only one header row allowed, make tables compatible with … Read more

VBA to sort sheets alphabetically

VBA Code Snippets

When working with Excel, the worksheets order matters.  The tabs should reflect the flow which a user can understand.  Since there is no native feature to do it, using VBA to short sheets alphabetically can be a useful time-saver. But things are never as straightforward, are they? In this post, I will give you the … Read more

VBA to hide all sheets except one

VBA Code Snippets

There is a common question that many Excel users ask: “How can I hide all sheets except one with a macro?”. So, let’s answer that very question. First, I’ll share with you the VBA to hide all sheets except one, and then the process to turn it into a reusable code block. Table of Contents … Read more

Excel VBA for Pivot Tables

VBA Code Snippets

Pivot Tables are a key tool for many Excel users to analyze data.  They are flexible and easy to use.  Combine the power of Pivot Tables with the automation of VBA, and we can analyze data even faster.  This post includes the essential code to control Pivot Tables with VBA. Table of Contents Refreshing Pivot … Read more