简体   繁体   English

excel vba select 两个数字之间的范围

[英]excel vba select range between two numbers

选择两个数字之间的范围

  1. C column is sorted from the input data C 列是从输入数据中排序的
  2. From the sorted output, the selected range should be with in -0.25 to +0.25从排序后的 output 中,选择的范围应该在 -0.25 到 +0.25 之间

How to add more than one criteria in COUNTIF function or its similar function?如何在 COUNTIF function 或其类似的 function 中添加多个条件?

Original syntax:原始语法:

.Resize(Application.CountIf(.Cells, "<0")).Select

Requirement:要求:

.Resize(Application.CountIf(.Cells, ">-0.25 & <0.25")).Select

Replace CountIf with CountIfs when you want more than one condition.当您需要多个条件时,将CountIf替换为CountIfs Try this:尝试这个:

.Resize(Application.WorksheetFunction.CountIfs(.Cells, ">-0.25", .Cells, "<0.25")).Select

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM