For decades, there was a fairly clear dividing line in Excel. As long as a problem could be solved with worksheet formulas, it remained within the confines of the grid. The moment the requirements became too complicated, too repetitive, or too procedural, the solution inevitably led into VBA. The Visual Basic Editor became the place where serious automation lived, and many Excel developers built entire careers on the ability to bridge the gap between spreadsheets and programming.
This division made sense. The worksheet environment, powerful though it was, had limitations that became increasingly apparent as workbooks grew in size and sophistication. Formulas could calculate, compare, and summarise, but they struggled when confronted with reusable logic, advanced text processing, or large-scale transformations. Whenever those limitations appeared, VBA stepped forward to fill the gap.
The arrival of modern Excel has complicated this picture considerably. Functions such as FILTER, UNIQUE, SORT, TEXTSPLIT, LET, LAMBDA, MAP, BYROW, and many others have dramatically expanded the capabilities of the worksheet itself. Problems that would once have been considered obvious candidates for VBA can now often be solved directly within formulas, sometimes more elegantly than before. As a result, the question facing modern Excel developers is no longer whether formulas or VBA are better. The more useful question is understanding where each approach is most appropriate.
To understand where the boundary now lies, it helps to remember why so many developers turned to VBA in the first place.
Part of the attraction was undoubtedly automation. A macro could open files, manipulate workbooks, create reports, export documents, and communicate with other applications. These capabilities remain enormously valuable today and continue to represent one of VBA's greatest strengths.
Equally important, however, was the ability to express logic that the worksheet simply could not accommodate. A complex calculation could be wrapped inside a user-defined function. A difficult text transformation could be implemented with loops and string operations. Repetitive calculations could be encapsulated and reused throughout a workbook.
In many respects, VBA acted as an escape valve. Whenever the grid became too restrictive, code provided a way forward. Nowadays, modern Excel has narrowed that gap considerably.
One of the most significant developments of recent years has been the movement of increasingly sophisticated logic into the worksheet itself. Consider text manipulation. For years, extracting values from delimited text required combinations of LEFT, RIGHT, MID, LEN, and FIND, often producing formulas that were difficult to read and even more difficult to maintain. Many developers simply wrote VBA functions instead.
Today, the same tasks can often be performed with functions such as:
or
Similarly, many lookup problems that once required elaborate combinations of INDEX and MATCH, or even custom VBA functions, can now be handled directly through XLOOKUP. Dynamic arrays have removed the need for many looping constructs, while LAMBDA has introduced the possibility of reusable functions directly within the workbook.
As these capabilities accumulate, the worksheet begins to absorb problems that once belonged firmly to the realm of code.
When a problem can be solved entirely within formulas, the result frequently offers several advantages.
The most obvious is visibility. Formulas exist within the workbook itself. They recalculate automatically, remain visible to other users, and can often be understood without opening a separate development environment. The logic lives alongside the data, which makes both troubleshooting and maintenance considerably easier.
There is also the matter of distribution. Formula-based workbooks tend to travel more easily between organisations and environments. They do not trigger macro security warnings, they require no trusted locations, and they generally avoid many of the deployment issues that accompany VBA projects.
Perhaps most importantly, formulas are inherently reactive. When the data changes, the result changes. No macro must be executed, no refresh button pressed, and no procedure run manually. The workbook simply continues to calculate.
These qualities make formulas particularly attractive whenever the problem itself is fundamentally about transforming data.
Yet for all the progress that modern Excel has made, there remain classes of problems that formulas are simply not designed to solve.
A formula cannot create a folder. It cannot save a PDF, rename a file, send an email, or open twenty workbooks stored on a network share. It cannot archive old reports, download data from another application, or automatically distribute output to different users.
This limitation is not a weakness. It reflects the fundamental nature of the worksheet. Formulas describe results. They declare relationships between inputs and outputs. They do not execute processes.
VBA, by contrast, is procedural. It performs actions in sequence, maintains state, responds to events, and interacts with the outside world. These capabilities remain as valuable today as they were twenty years ago.
The question therefore becomes one of classification. Is the problem primarily concerned with data, or is it concerned with process? Many of the clearest design decisions arise when problems are viewed through this distinction.
Suppose a workbook contains thousands of sales records and the objective is to identify commissions, calculate bonuses, apply business rules, and generate analytical summaries. This is fundamentally a data problem. Modern formulas are often exceptionally well suited to such work because they allow the logic to remain visible, dynamic, and tightly integrated with the data itself.
By contrast, imagine a monthly reporting system that must collect files from multiple departments, import their contents, refresh calculations, export individual reports, save PDFs, archive historical versions, and email the results to management. This is not primarily a calculation problem. It is a workflow problem. Attempting to solve this problem entirely with formulas would be as inappropriate as solving the first entirely with VBA. Each technology has strengths that reflect its underlying design.
As modern Excel has evolved, one particularly effective architectural approach has emerged: the worksheet performs the calculations, and VBA performs the orchestration. Under this model, formulas handle filtering, transformation, lookups, business rules, and calculations. Dynamic arrays produce reports, LAMBDA functions encapsulate reusable logic, and modern text functions prepare imported data.
VBA operates at a higher level. It imports data, triggers refreshes, exports results, manages files, communicates with external applications, and coordinates the sequence of events required by the business process. The workbook itself becomes the analytical engine, while VBA becomes the automation layer surrounding it.
This division often produces systems that are both easier to maintain and easier to extend.
One area where the change is particularly visible is the traditional VBA user-defined function. For many years, developers routinely wrote custom functions to split text, perform advanced lookups, handle arrays, or implement reusable calculations. These functions filled gaps in Excel's capabilities, but many of those gaps no longer exist.
The modern developer may discover that functions once considered indispensable can now be replaced with native worksheet functionality. This does not render VBA functions obsolete, but it does make them more specialised. Custom functions increasingly address highly specific business requirements rather than compensating for missing worksheet features.
In many ways, this is a positive development. Native functions tend to perform better, distribute more easily, and remain accessible to a wider audience.
Perhaps the most important change is not technical at all. Historically, many developers approached Excel with a straightforward question: can this be done with VBA? Today, the more useful question is: where should this logic live? Sometimes the answer will be the worksheet. Sometimes it will be VBA. Quite often, it will involve both.
This shift encourages a more thoughtful approach to workbook design. Instead of viewing formulas and code as competing solutions, they become complementary tools that solve different categories of problems. The goal is no longer to write as much code as possible, nor to eliminate VBA entirely. The goal is to place each piece of logic in the environment where it naturally belongs.
The remarkable expansion of formula capabilities has not diminished VBA's importance. Instead, it has allowed each technology to focus on what it does best.
The worksheet has become vastly more expressive, capable of transformations and calculations that would once have required procedural code. VBA continues to excel at automation, integration, and process management.
The most effective Excel solutions increasingly combine these strengths. Formulas perform the calculations. Dynamic arrays reshape the data. Named functions encapsulate business rules. VBA automates the surrounding workflow and connects the workbook to the wider world. Neither side has won because there was never truly a competition. The relationship between formulas and VBA has simply matured, and understanding that relationship has become one of the defining skills of the modern Excel developer.
Cat On A Spreadsheet