小编Ahm*_*nal的帖子

如何使用数组函数从vba excel中的数字创建序列月?

我想制作一些数组函数来帮助我创建报告,假设我有数字= 4然后我打算让它成为1,2,3,4然后最后这些数字将被转换为"1月","2月" ,"三月四月".我试图创建这个功能,但没有任何作用.

Function numtomonth(num As Integer)
r As Long
a As Integer
h As Long

For a = 1 To num
r(a) = a
If r = 1 Then r = "January"
If r = 2 Then r = "February"
If r = 3 Then r = "March"
If r = 4 Then r = "April"
If r = 5 Then r = "May"
If r = 6 Then r = "June"
If r = 7 Then r = …
Run Code Online (Sandbox Code Playgroud)

excel vba excel-vba

3
推荐指数
1
解决办法
1467
查看次数

标签 统计

excel ×1

excel-vba ×1

vba ×1