Skip to content
本页内容

Find (方法)

在工作表中查找特定信息。

参数

属性数据类型必填说明
Arg1str必填工作表名称。
Arg2str必填区域名称。
Arg3Any可选精确限制查询的参数名称。

返回值

float

示例

python
#本示例分别赋值B1等单元格,使用 Find 方法查找参数1字符串开始的位置
def test():
    Range("B1").Value2 = "World"
    Range("B2").Value2 = "hello,World!"
    Range("B3").Value2 = 4
    print(WorksheetFunction.Find(Range("B1").Value2, Range("B2").Value2, Range("B3").Value2))
python
#本示例使用 Find 方法查找参数1字符串开始的位置,并分别赋值给E1等单元格
def test():
    Range("E1").Value2 = WorksheetFunction.Find("in", "Believe in yourself.")
    Range("E2").Value2 = WorksheetFunction.Find("bird", "The bird who dares to fall is bird who learns to fly.", 2)