Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
楼主: 兰色幻想

[习题] 最接近数字100的单元格(参考答案在1楼)

[复制链接]
发表于 2008-6-23 11:15 | 显示全部楼层
回复

使用道具 举报

发表于 2008-6-23 12:57 | 显示全部楼层

好久没有练习,试试看还记得多少^_^

Sub MIN()<br/>Dim arr0, arr, i As Integer, S As Integer<br/>arr0 = Range("A1:A" &amp; Cells(65536, 1).End(xlUp).Row)<br/>ReDim arr(1 To UBound(arr0))<br/>For i = 1 To UBound(arr0)<br/>&nbsp;&nbsp;&nbsp; arr(i) = Abs(100 - arr0(i, 1))<br/>Next i<br/>S = Application.WorksheetFunction.Match(Application.WorksheetFunction.MIN(arr), arr, 0)<br/>MsgBox "最接近的数值是" &amp; Cells(S, 1) &amp; ",地址是" &amp; Cells(S, 1).Address<br/>End Sub<br/>
回复

使用道具 举报

发表于 2009-12-6 01:31 | 显示全部楼层
回复

使用道具 举报

发表于 2015-5-27 20:07 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

发表于 2015-5-28 11:09 | 显示全部楼层
谢谢您的分享
回复

使用道具 举报

发表于 2015-5-28 16:51 | 显示全部楼层
1111111111111111111111
回复

使用道具 举报

发表于 2017-3-2 13:21 | 显示全部楼层
ffdfdfdds
回复

使用道具 举报

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

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-4-29 03:31 , Processed in 0.286988 second(s), 3 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表