标题:帮忙修改下代码?
只看楼主
sfadfa
Rank: 1
等 级:禁止访问
帖 子:22
专家分:0
注 册:2014-11-21
得分:0 
Sub Macro1()
i = Range("A65536").End(xlUp).Row
Set m = Range("B65536").End(xlUp)
ReDim arr(1 To (i - m.Row), 1 To 1)
k = Left(m.Value, 4)
a = Mid(m.Value, 5, Len(m.Value) - 5)
L = Len(a)
a = a + 1
For j = 1 To i - m.Row
    n = n + 1
    If n > 3 Then
        n = 1
        a = a + 1
    End If
    If Len(a) < L Then
        For x = 1 To L - Len(a)
            a = "0" & a
        Next
    End If
    arr(j, 1) = k & a & n
Next
m.Offset(1, 0).Resize(j - 1, 1) = arr
End Sub
2014-11-22 22:15



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-403545-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.241271 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved