Category Archives: Excel

How to Use CountIf in VBA

In Excel, the function CountIf is used to count how many times a condition has been met within a worksheet range. However, to use this function while writing VBA code, we need to change it from CountIf to WorksheetFunction.CountIf. The full syntax of the function

option explicit is automatically filled in

Everything About Option Explicit in VBA

As a developer, it is a good practice to declare your variables in a script/code so that you immediately get the source of an error when running it. Option Explicit is used in VBA precisely to make the defining of variables mandatory while writing code.

convert table dialog box

How to Convert a Word or Excel Table to Text

The Table object in Excel and Word is underutilized by most users and developers of Excel and Word, in my not-so-humble opinion. For example, an Excel Table object with formulas calculates faster and takes less storage space than does the comparable normal range. As useful

scraping from wikipedia

GetElementById in VBA

Visual Basic for Applications allows you to get data and information from websites. This is called ‘web scraping’. Web pages are written in a markup language called HTML. Anything that interests you in a webpage can be retrieved once we know which HTML element it

How to use the OnKey method in Excel VBA

As a VBA developer you sometimes need to use a key or a combination of keys to run a procedure without using the command button on a UserForm. This is possible with the VBA onkey method. Syntax The syntax for the OnKey method is: Application.OnKey

How to delete columns in Excel using VBA

In this article we will see how to delete columns in Excel using VBA. Example 1: Delete an entire column in a sheet using column number: Say, the Excel data that is of the form below and you need to delete the column for May-18

privacy policy