See Also

IRange Interface  | IRange Members  | Find Method  | LookAt Enumeration  | SearchOrder Enumeration

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Language

Visual Basic

C#

C++

C++/CLI

Show All

what
Specifies the text to to find.
replacement
Specifies the replacement text.
lookAt
Specifies partial or complete match.
searchOrder
Specifies whether to search by rows or by columns.
matchCase
Specifies whether text searches should match case.
See Also Languages SpreadsheetGear The Performance Spreadsheet Component Company 

Replace Method

SpreadsheetGear Namespace > IRange Interface : Replace Method

Attempts to replace the specified text according to the specified options, returning the number of replacements if successful or zero if not successful.

[Visual Basic]
Overridable Function Replace( _    ByVal what As String, _    ByVal replacement As String, _    ByVal lookAt As LookAt, _    ByVal searchOrder As SearchOrder, _    ByVal matchCase As Boolean _ ) As Integer
[C#]
virtual int Replace(    string what,    string replacement,    LookAt lookAt,    SearchOrder searchOrder,    bool matchCase );
[C++]
virtual int Replace(    string* what,    string* replacement,    LookAt lookAt,    SearchOrder searchOrder,    bool matchCase )
[C++/CLI]
virtual int Replace(    String^ what,    String^ replacement,    LookAt lookAt,    SearchOrder searchOrder,    bool matchCase )

Parameters

what
Specifies the text to to find.
replacement
Specifies the replacement text.
lookAt
Specifies partial or complete match.
searchOrder
Specifies whether to search by rows or by columns.
matchCase
Specifies whether text searches should match case.

Return Type

Returns the number of replacements if successful or zero if not successful.

Remarks

Locked cells in a protected worksheet will be ignored.
Array formulas will be ignored in cells other than the top-left cell of the array formula range. Replacing the formula in the top-left cell of the array formula range will modify all formulas in the array formula range.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

IRange Interface  | IRange Members  | Find Method  | LookAt Enumeration  | SearchOrder Enumeration

 

 


See our live Excel Reporting, Excel Charting, Excel to DataGrid and Excel Calculation Samples.

Copyright © 2003-2007 SpreadsheetGear LLC. All Rights Reserved.

SpreadsheetGear and Spreadsheet Gear are trademarks of SpreadsheetGear LLC.