The Sum function in Excel is one of the most widely used functions, and in fact, probably one of the first functions that an Excel user learns when they are learning to use Excel! Simply stated, the Sum function adds up a range of cells for
VBA is the programming language behind Microsoft Office. It is derived from a programming language called Basic. VB (Visual Basic) is also derived from Basic. For nearly all programming purposes, they are the same language. VB can either refer to straight Visual Basic (the last version
One of the more frustrating errors to occur in VBA is the Automation Error. It can often pop up for no apparent reason despite your code looking perfect. Reasons for This Error There are a variety of reasons that this can occur. Microsoft Office is
The VLookup function is an Excel function. It can be used directly on your worksheet without having to use any VBA code. However, there may be instances in VBA where you wish to also use VLookup functionality. You would then need to call the VLookup
The Instr function in VBA checks to see if a string is contained within another string. This can be useful when trying to extract information from strings of data contained in Excel cells, for example. Instr Syntax The Instr function is made up of 4
The ReDim statement is used to declare the size of a Dynamic array in VBA. It can later be used to re-declare the size of the array as many times as you need. It can only be used for Dynamic VBA Arrays (where the size
There may be a time in Excel that you need data that you are fetching from an Excel spreadsheet or importing from external data to be amended to upper case. This can, of course, be done manually, but if it is a large amount of
Even when your code is perfectly constructed, the user might not always do what you would expect. For this reason, you need to insert error handlers into your code whenever there might be a reason that an error might occur. Handling an error when incorrect
The VBA Replace function is a function which you can use in your code to replace one set of string characters with another set of string characters, or to replace a set of string characters with an empty string. For example, you may have a
A VBA Variant is a VBA variable that has not been declared to have a specific data type. It can therefore hold any type of data that VBA variables are able to hold – be it text, numbers, dates, time or objects. Variants use more