[英]Excel VBA select entire sheet using Range
我正在使用以下代码在工作表中进行搜索,以查找单词“ example”出现了多少次。
count = Application.WorksheetFunction.CountIf(Range("A1:A10"), "example")
我似乎无法弄清楚如何使用Range函数遍历整个工作表。
为什么需要遍历整个工作表? 您可以更改范围吗?
A1:A10
count = Application.WorksheetFunction.CountIf(Range("A1:A10"), "example")
A1:E10
count = Application.WorksheetFunction.CountIf(Range("A1:E10"), "example")
整张纸
count = Application.WorksheetFunction.CountIf(ActiveSheet.Cells, "example")
尝试在下面查找整个工作表中的字符串“ example”。
Count = Application.WorksheetFunction.CountIf(Cells, "example")
使用通配符
Count = Application.WorksheetFunction.CountIf(Cells, "*example*")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.