Category Archives: Sample Codes and Downloads

Access Word Objects through Excel VBA

In this article, we will see how to access the various word objects using VBA in Excel and insert data from Excel to Word. This has many practical applications such as when you have to fill out a form multiple times with data from Excel or

The Excel VBA Application.FileDialog Object

Have you ever wished you could develop a simple way for users to select files to open from within Excel? Perhaps you want to impose a level of control over which file path users select the file(s) from. This can be done by using the

No Thumbnail

Excel VBA, Font Strikethrough

In this article I will explain how you can use VBA to add strikethrough to the font of cells and ranges. I’ve also provided a sample code which checks if a cell has the strikethrough font or not. You can download the file and code

No Thumbnail

Excel VBA, Fill Pattern

Various different patterns can be applied to cells in Excel. These patterns can be applied manually using the Format Cell dialog: This article will explain how you can apply different patterns to cells using VBA for Excel. Jump To: Basics Example 1, Set Pattern Example

No Thumbnail

VBA Excel, Writing to a Text File

In this article I will explain how you can create a text file and how write data to a text file in overwrite and append modes.  You can download the file and code related to this article here. Create a text file using the file system

No Thumbnail

Excel VBA Chr() Function

In this article I will explain about the Chr() function. The Chr() function is a very useful function when working with strings and Excel columns. Generally speaking, numbers and characters are mapped. Meaning that each character is mapped to a number and vice versa. For

No Thumbnail

Excel VBA, Set Cell Alignment Properties (Sample Code + Download)

In this article I’ve provided a sample code that will set the alignment properties of the cells in the first row using VBA. The user selects different alignment properties using the drop down lists provided. The program then updates the alignment properties of the cells in row

No Thumbnail

Excel VBA Set Underline (Sample Code + Download)

In this article I’ve provided an example on how you could use VBA to set underlines for cells and ranges. There are 4 different underline style the user can select from: Single Double Single Accounting Double Accounting For more information about the different underline types and their associate VBA code please

No Thumbnail

Excel VBA, Border Style and Thickness

In this article I will explain how you can modify border thickness and style using VBA for Excel. For more information about creating borders please see Excel VBA, Create Border. In that article I’ve explained how you can create a border for the different sections of a