Category Archives: VBA

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

No Thumbnail

Access VBA Get Field Names

In this article I will explain how you can get the names of all the fields in a table an access database using VBA. The first step would be to get the name of the table. The article below explains how you can get the name of all

No Thumbnail

Word VBA, Save Table as JPEG

In this article I will explain how you save a word table as a JPEG using VBA for word. Unless if you are willing to using windows API functions, I have yet to find a direct method for doing this in VBA for word. The

No Thumbnail

Check If Table Exists, Access VBA

In this article I will explain how you can check if a table exists in an access database using VBA. Previously in the article below I’ve explained how you can get the name of all the Tables in an external access database using VBA: VBA

No Thumbnail

Word VBA, Apply Macro to Multiple Files

In this article I will explain how you can use VBA for word to open multiple files and modify them. – Step 1: Put all the word documents that you want to modify in one folder. Note the file with the VBA code should be

No Thumbnail

Excel Speed, IF (Formula vs VBA)

I have conducted several tests to see the fastest way to implement an If function in Excel. In these tests I have compared the native excel IF() function, with several methods of using the “if” statement in VBA. Each test basically executes the following algorithm

No Thumbnail

Excel VBA, XlRgbColor

The enum XlRgbColor contains a list of color codes. Although this list is 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 with some of