数组:89 65 46 34 20 16六个数据中求个位的最大值最小值,不知用vba excel如何表示,谢谢

[复制链接]
查看11 | 回复3 | 2011-6-14 12:42:37 | 显示全部楼层 |阅读模式
Sub CHA()
Dim a As Range, s, res, i, iMin, iMax
s = Split("89 65 46 34 20 16", " ") '获取数据
ReDim res(LBound(s) To UBound(s))
For i = LBound(s) To UBound(s)
res(i) = Val(Right(s(i), 1))
Next
iMin = Application.WorksheetFunction.Min(res)
iMax = Application.WorksheetFunction.Max(res)
...
回复

使用道具 举报

千问 | 2011-6-14 12:42:37 | 显示全部楼层
EXCEL 求最大值 =MAX()
求最小值=MIN()...
回复

使用道具 举报

千问 | 2011-6-14 12:42:37 | 显示全部楼层
Sub Macro1()Maximum = 0Minimum = 10
Range("I14").Select
Selection.ClearContentsFor i = 1 To 6If Cells(1, i) - Int(Cells(1, i) / 10) * 10 > Maximum ThenMaximum...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行