我正在使用 EXCEL VBA 处理一些数据,这就是我想要做的:
在此工作表中,我想创建一个函数“GetDebutDate”,它可以自动计算该行具有值的第一个日期。
例如,在“Mark”行中,第一次获取值是Aug-05,编号为“4”。
我对 VBA 知之甚少,经过搜索后我发现我可以使用For ... Each
在一个范围内循环。但是如何获得每个循环中“v”的索引呢?获取该索引后,如何获取头行中日期的值?
Function Get_Board_Count(range As range)
For Each v In range
....
Next
Get_Board_Count = ....
End Function
Function Get_Board_Count(range As range)
dim i as integer
i = 1
for each v in Range
...
i = i + 1
next
Get_Board_Count = i 'Index of the item where cell is found.
End Function
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)