Tag Archives: Range

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, Range Fill Color

The following lines all changes the fill color of the range “A1:B1” to blue: Range(“A1:B2”).Interior.Color = vbBlue Same as the previous line but using a different notation: Range(Cells(1, 1), Cells(2, 2)).Interior.Color = vbBlue Same as the previous lines but instead of using the blue color constant

No Thumbnail

Excel VBA, Horizontal Alignment

In this article I will explain the different horizontal alignment formattings applicable to cells and range. I have also provided the VBA code required to apply them. For examples using horizontal alignment in VBA code please see: Excel VBA, Set Horizontal Alignment, (Sample Code) Excel

No Thumbnail

Access VBA, Import Excel Worksheet to Existing Table

In this article I will explain how you can import values from an excel worksheet to an existing table in Access using VBA. – DoCmd.TransferSpreadsheet: The values in the excel worksheet are imported using the DoCmd.TransferSpreadsheet Method: Syntax: Call DoCmd.TransferSpreadsheet(TransferType, SpreadSheetType, TableName, Filename, HasFieldNames, Range) TransferType: The

No Thumbnail

Excel VBA, Row Fill Color

The following line changes the fill color of the first row to blue: Rows(1).Interior.Color = vbBlue Same as the previous line but instead of using the blue color constant it uses the blue color code Rows(1).Interior.Color = 16711680 For more information about working with colors in

No Thumbnail

Excel VBA, Save Range/Cells as JPEG

In this article I will explain how you can use VBA for Excel to save a range of cells as a JPEG image. Basically what we do is the following: Create an empty chart in some sheet which is not used. Copy the cells with

No Thumbnail

Excel VBA Range Gradient Color

In the article Excel VBA, Gradient’s Colors I’ve explained the basics about working with gradient colors. I’m assuming readers are familiar with the concepts explained in that article before reading this article. Jump To: Gradient Color, Range Modify Existing Gradients Color for Range – Gradient Color, Range: