Set the Border Color of Excel Cells by VBA Color/ColorIndex Properties
You may use Borders.ColorIndex property to set the border color from available 56 color palette
You may use Borders.ColorIndex property to set the border color from available 56 color palette
Hiding columns in VBA By using Worksheet’s Columns property, you may hide one or more…
To select a row in an Excel sheet, you may use the Range object Rows property. You may select one or more rows by using the Rows property
For one dimensional array, you may get the array length (size) by using UBound function.
How to create arrays in VBA by using different ways. Accessing array elements by index. One-dimensional and two definitional arrays (using Excel Sheet)
Basically, Not operator negates the given condition. It is used to reverse the result of a condition or expression.
The interior (background) color of the cells in the Excel sheet can be set by using the VBA ColorIndex property.
As we know, VBA has “Exit For”, “Exit Do” to come out of the loop entirely – which is achieved by the break statement (normally in other programming languages).
In programming languages, there is normally a break statement is available to exit a loop (For, While, Do While) while it is still not completed. There is no break statement in VBA.
In VBA, a newline can be added by using following: vbNewLine constant vbCrLf constant vbCr constant
The For..Each is a loop type in VBA. This loop is used to execute one or more statements for arrays or collections
In VBA, you may concatenate values, strings, variables, and Excel data by using the ‘&’ operator.
VBA If..And statement is used when you have to test multiple conditions to execute one or more statements.
A new sheet can be added by Sheets object’s Add method. For example,
Sheets.Add
This code will add a sheet before the active sheet in your Workbook.
In this tutorial, how to make a non-active sheet in Excel an active sheet by using VBA code.