application.selection
returns the currently selected object, for example a range
or picture
object. selection
refers to can be determined with typename(selection)
which returns Range
, Picture
etc. selectionChange
is fired. range.select
method. sub main() range("b3:c5").select ' ' After selecting a range, application.selection accordingly ' is a range. typeName(…) prints "Range". ' debug.print typeName(application.selection) ' ' We can now use application.selection to change ' the properties of the selected range ' with application.selection .font.name = "Courier New" .numberFormat = "0.000" .interior.color = rgb(220,220,255) end with end sub