Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
VBA用于在“工作表”列中的不同Excel工作表中搜索字符串,并显示包含该字符串的工作表_Vba_Excel - Fatal编程技术网

VBA用于在“工作表”列中的不同Excel工作表中搜索字符串,并显示包含该字符串的工作表

VBA用于在“工作表”列中的不同Excel工作表中搜索字符串,并显示包含该字符串的工作表,vba,excel,Vba,Excel,Ex:我想搜索所有工作表中的“退货订单”字符串,但工作表中的列包含其中的句子Ex(未到达退货订单)。任何工作表包含所需字符串,则应显示该工作表 Sub ertdfgcvb() Dim ws As Worksheet, rng As Range, str1 As String str1 = " return order" On Error Resume Next For Each ws In ActiveWorkbook.Worksheets If ws.Index > Active

Ex:我想搜索所有工作表中的“退货订单”字符串,但工作表中的列包含其中的句子Ex(未到达退货订单)。任何工作表包含所需字符串,则应显示该工作表

Sub ertdfgcvb()
Dim ws As Worksheet, rng As Range, str1 As String
str1 = " return order"
On Error Resume Next
For Each ws In ActiveWorkbook.Worksheets
    If ws.Index > ActiveSheet.Index Then 'after the currently open worksheet
        Set rng = ws.Cells.Find(What:=str1, LookAt:=xlPart) 'tries to find your string
        ws.Select 'if it manages then selects the worksheet
        rng.Select 'and the cell in which it found the string
        Exit Sub
    End If
Next
End Sub
您的规格不太清楚,这里有一个脚本可以开始使用。
不,跟进是不可能的,我们不是随叫随到的编程服务