|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
哦,这样试试
Function NQUYU(rng As Range, a, b, Optional n = 3)
Dim ar, i: ar = rng
If Not IsArray(ar) Then ReDim ar(1 To 1, 1 To 1): ar(1, 1) = rng Else ar = rng
For i = 1 To UBound(ar)
If ar(i, 1) <> "" Then
If CLng(ar(i, 1)) > CLng(a) - 1 And CLng(ar(i, 1)) < CLng(b) + 1 Then
ar(i, 1) = Format(Int((CLng(ar(i, 1)) - CLng(a)) * n / (CLng(b) + 1 - _
CLng(a))) & CLng(ar(i, 1)) Mod n, "00")
Else
ar(i, 1) = ""
End If
Else
ar(i, 1) = ""
End If
Next
NQUYU = ar
End Function
|
评分
-
2
查看全部评分
-
|