Application Object and Important Properties in VBA for Excel

Application Object is the highest object in Excel, followed by Workbook, followed by Worksheet and followed by Column, Row and cell. You can select object by going from highest to lowest in Excel.

Application.WorkBooks(2).WorkSheest(3).Rows(5).select

Application.WorkBooks(2).WorkSheest(3).Cell(2.1).select

Properties

Here are the key properties

ActiveCell – Returns the currently active cell (the one with cursor)

ActiveSheet – Returns the current sheet (the one with the cursor)

ActiveWorkbook – Returns the currently active workbook

RangeSelection – Returns selected cell range.

ActiveWindow – Returns active window object.

ThisWorkbook – Returns workbokok where macro is running

Method

InputBox - display as box which promots user for a value

MsgBox – is used to display message

Offset – is used to access a cell based on row and clumn index

Run – will run a macro

Move/Create/Add/Delete – Used to move/Create/add/delete object

Related Posts

Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email will not be published. Required fields are marked *

*
*