Collabora Office 24.04 帮助
返回一个字符串, 指示数字在计算的序列范围内出现的位置。
Partition( Number, Start, Stop, Interval)
String
「数字」: 必填。要确定分区的数字。
「开始」: 必填。一个整数, 定义数字范围的下限。
Stop: Required. An integer number defining the highest value of the range.
Interval: Required. An integer number that specifies the size of the partitions within the range of numbers (between Start and Stop).
Option VBASupport 1
Option Explicit
Sub Test_Partition
Dim retStr As String
retStr = Partition(20, 0, 98, 5)
print "20:24 数字 20 位于范围: " & retStr
retStr = Partition(20, 0, 99, 1)
print " 20: 20 数字 20 位于范围: " & retStr
retStr = Partition(120, 0, 99, 5)
print "100: 数字 120 位于范围: " & retStr
retStr = Partition(-5, 0, 99, 5)
print " : -1 数字 -5 位于范围: " & retStr
retStr = Partition(2, 0, 5, 2)
print " 2: 3 数字 2 位于范围: " & retStr
End Sub