Web Development

The difference between VBA functions and statements


Office supports Visual Basic for Applications (VBA), a development language. Some users never need VBA, but most of us at least dabble with it a bit. VBA offers a number of built-in functions and knowing which one to use can be a chore for anyone new to development. Fortunately, there’s good help available:

  1. In the Visual Basic Editor (VBE), choose Microsoft Visual Basic from the Help menu.
  2. In the resulting Help task pane, click the Microsoft Visual Basic Documentation link to display a list of subjects.
  3. Click the Functions or Statements link to display a graduated alpha listing.

Being familiar with the available functions—and there are many—is vital to working efficiently with VBA. Now, you might be wondering whether you need a function or a statement. While we often use the terms interchangeably, they really aren’t. Statements have been around since the beginning. Never versions have replaced statements with VBA functions. For that reason, always use a function if possible. They have the most up-to-date functionality. There may be a similar statement, but don’t use it. Office supports them only for backward compatibility. They could disappear from a future version, without notice.

About

Susan Sales Harkins is an IT consultant, specializing in desktop solutions. Previously, she was editor in chief for The Cobb Group, the world's largest publisher of technical journals.

2 comments
vishalluthra
vishalluthra

I have never worked on VBA, but as it linked with visual basics I am deeply interested in knowing the difference between two.

ssharkins
ssharkins

In a nutshell: Visual Basic is a development tool (software package). VB.Net is a .NET compatible version of Visual Basic. Visual Basic for Applications (VBA) is the development language that comes with MS Office. Hope that helps.