Application.SetActiveCell Method

Project Developer Reference

Sets the value of the active cell.

Syntax

expression.SetActiveCell(Value, Create)

expression   A variable that represents an Application object.

Parameters

Name Required/Optional Data Type Description
Value Required String The new value for the active cell.
Create Optional Boolean True if a new assignment, resource, or task should be created when setting the value of the active cell, if one doesn't already exist. The default value is True.

Return Value
Boolean

Remarks

The SetActiveCell method is not available when the Calendar, Network Diagram, or Resource Graph is the active view.

Example
The following example enters the specified text in the active cell. It assumes the active cell accepts string input.

Visual Basic for Applications
  Sub AddCommentToTable()
Dim M As String

M = InputBox$("Enter your comment: ")
<strong class="bterm">SetActiveCell</strong> M, False

End Sub

See Also