Excel - ActiveCell
Be careful to distinguish between the active cell and the selection. The active cell is a single cell inside the current selection. The selection may contain more than one cell, but only one is the active cell.
You can use the Activate method to designate which cell is the active cell.
'B5 is the active cel
ActiveCell.Font.Bold = True
If you don't specify an object qualifier, this property returns the active cell in the active window.
You can work with the active cell only when the worksheet that it is on is the active sheet.
The following expressions all return the active cell, and are all equivalent.
changes the font formatting for the active cell with the with statement
'You can work with the active cell only when the worksheet that it is on is the active sheet.
.Bold = True
.Italic = True
ActiveCell.Value = 35
You can use the Offset property to move the active cell.
The following procedure inserts text into the active cell in the selected range and then moves the active cell one cell to the right without changing the selection.
ActiveCell.Value = "Monthly Totals"
The CurrentRegion property returns a range of cells bounded by blank rows and columns.
If you do not know the boundaries of the range, the CurrentRegion property will return the range that surrounds the active cell (ie the cell selection will stop when an empty row and an empty column is found around the active cell)
You can then also loop through it.
For Each c In ActiveCell.CurrentRegion.Cells
If Abs(c.Value) < 0.01 Then c.Value = 0