How to: Display a String in a Worksheet Cell
This example demonstrates how to display text in a cell programmatically. To display text in cell, use either a NamedRange control or a native Excel range object.
Applies to: The information in this topic applies to document-level projects and application-level projects for Excel 2007 and Excel 2010. For more information, see Features Available by Office Application and Project Type.
This example uses a NamedRange control named message. The control must be added to a document-level customization at design time. The following code must be placed in a sheet class, not in the ThisWorkbook class.