Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

根據指定的篩選條件,傳回包含字串陣列子集的零型陣列。

語法

篩選 ( sourcearray ,比對 [, include ] [, compare ] )

Filter 函數語法具有下列自變數:

引數

描述

sourcearray

必要。 要搜尋的一維字串數位。

匹配

必要。 要搜尋的字串。

include

選擇性。 指出 是否要傳回包含或排除 相符之子字串的布爾值。 如果 includeTrue, Filter 會傳回包含相符做為子字串之陣列的子集合。 如果 includeFalse,Filter 會傳回不含相符值之陣列的子集合做為子集合。

compare

選擇性。 指出要使用的字串比較類型的數值。 請參閱值的 [設定] 區段。


設定

compare 自變數可能具有下列值:

常數

描述

vbUseCompareOption

–1

使用 [選項比較 ] 語句的設定執行比較。

vbBinaryCompare

0

執行二進位比較。

vbTextCompare

1

執行文字比較。

vbDatabaseCompare

2

Microsoft Office Access 2007 。 根據資料庫中的資訊執行比較。


註解

如果在sourcearray中找不到相符專案,Filter會傳回空白陣列。 如果 sourcearrayNull 或非一維陣列,就會發生錯誤。

Filter 函數傳回的數位只包含足夠的元素,可以包含相符項目的數量。

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×