Tutorial by Examples

A Range cannot be created or populated the same way a string would: Sub RangeTest() Dim s As String Dim r As Range 'Specific Type of Object, with members like Address, WrapText, AutoFill, etc. ' This is how we fill a String: s = "Hello World!" ' But we can...
The simplest way to refer to a single cell on the current Excel worksheet is simply to enclose the A1 form of its reference in square brackets: [a3] = "Hello!" Note that square brackets are just convenient syntactic sugar for the Evaluate method of the Application object, so technicall...
To save a reference to a cell in a variable, you must use the Set syntax, for example: Dim R as Range Set R = ActiveSheet.Cells(3, 1) later... R.Font.Color = RGB(255, 0, 0) Why is the Set keyword required? Set tells Visual Basic that the value on the right hand side of the = is meant to be ...
Offset(Rows, Columns) - The operator used to statically reference another point from the current cell. Often used in loops. It should be understood that positive numbers in the rows section moves right, wheres as negatives move left. With the columns section positives move down and negatives move ...
Sub TransposeRangeValues() Dim TmpArray() As Variant, FromRange as Range, ToRange as Range set FromRange = Sheets("Sheet1").Range("a1:a12") 'Worksheets(1).Range("a1:p1") set ToRange = ThisWorkbook.Sheets("Sheet1").Range("a1")...

Page 1 of 1