Skip to content

Latest commit

 

History

History
64 lines (41 loc) · 1.69 KB

Excel.Application.ActiveCell.md

File metadata and controls

64 lines (41 loc) · 1.69 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Application.ActiveCell property (Excel)
vbaxl10.chm183074
vbaxl10.chm183074
Excel.Application.ActiveCell
7ebfbec8-dc4e-36c5-188a-347d42649e76
04/04/2019
high

Application.ActiveCell property (Excel)

Returns a Range object that represents the active cell in the active window (the window on top) or in the specified window. If the window isn't displaying a worksheet, this property fails. Read-only.

Syntax

expression.ActiveCell

expression A variable that represents an Application object.

Remarks

If you don't specify an object qualifier, this property returns the active cell in the active window.

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.

The following expressions all return the active cell, and are all equivalent.

ActiveCell 
Application.ActiveCell 
ActiveWindow.ActiveCell 
Application.ActiveWindow.ActiveCell

Example

This example uses a message box to display the value in the active cell. Because the ActiveCell property fails if the active sheet isn't a worksheet, the example activates Sheet1 before using the ActiveCell property.

Worksheets("Sheet1").Activate 
MsgBox ActiveCell.Value

This example changes the font formatting for the active cell.

Worksheets("Sheet1").Activate 
With ActiveCell.Font 
 .Bold = True 
 .Italic = True 
End With

[!includeSupport and feedback]