Category Archives: VBA

No Thumbnail

VBA Access Add Fields

In this article I will explain how you can add fields to a table in an access database using VBA. If the database does not contain any tables, you can use the topic covered in the article below to create tables for it: VBA Access Create

No Thumbnail

Excel VBA, Apply Fill Pattern to Rows

Jump To: Apply Fill Pattern to Row Modify Row’s Fill Pattern Color – Apply Fill Pattern to Row: The following line of code applies the Reverse Diagonal Stripe fill pattern to row 3: Rows(2).Interior.Pattern = xlDown Note: The intellisense may not work while working with the Rows member.

No Thumbnail

Excel VBA, Get Vertical Alignment (Sample Code)

In this article I will provide an example on how to find cells with a specific vertical alignment. You can download the code and file related to this article here. The user selects the desired vertical alignment to find from a drop down list: After pressing the run button

No Thumbnail

VBA Access Get Table Names

In this article I will explain how you can get the names of all the tables in an access database using VBA. – Get Table Names: In the example below the names of the tables will be stored in a string array. The database used in

No Thumbnail

Excel VBA, ColorConstants

The class ColorConstants contains a list of color codes. Although this list is very limited but often it is enough to get the job done. If you require more specific colors please see Excel VBA, Color Code. In the example below the color code associated

No Thumbnail

Excel VBA, Apply Fill Pattern to Column

Jump To: Apply Fill Pattern to Column Modify Column’s Fill Pattern Color – Apply Fill Pattern to Column: The following line of code applies the Reverse Diagonal Stripe fill pattern to column B: Columns(2).Interior.Pattern = xlDown Note: The intellisense may not work while working with the Columns

No Thumbnail

Excel VBA, Vertical Alignment

In this article I will explain the different vertical alignment formattings applicable to cells and ranges. I have also provided the VBA code required to apply them. Jump To: Top, xlTop Center, xlCenter Bottom, xlBottom Justify, xlJustify Distributed, xlDistributed – Top, xlTop: The following code will top align the text in cell “A1”: Range(“A1”).VerticalAlignment = xlTop

vba color change fill example blue

Excel VBA, Cell Fill Color

In this article I will explain how you can set and get the fill color of cells using VBA. There are many times you may need to set the background colors of certain cells based upon a condition. Using conditional formatting is not always feasible as

No Thumbnail

VBA, Working With Arrays

In this article I will explain some of the main concepts of working with arrays. Using arrays is a great way of working with lists or groups of variables. Jump To: Arrays, Static Vs Dynamic Declaring Static Arrays 1 Dimensional Static Arrays 2 Dimensional Static