随机生成MAC地址的VBA脚本

unction product_alphabet(num As Integer)
Dim alphabet As String
Dim S As Integer
Dim str As Integer
Dim C As String
S = Int(Rnd() * 24 + 1)
C = Mid("A0B1C2D3E4F5G6H7I8J9KLMNOPQRSTUVWXYZ", S, 2)
product_alphabet = C
End Function

Function product_mac(str As String)
Dim i As Integer
Dim mac As String

If str = "" Or str = "无" Then
mac = "00"
For i = 1 To 5
mac = mac & "-" & product_alphabet(2)
Next
str = mac
End If
product_mac = str
End Function

Function product_masksub(str As String)
product_mask = ""
End Function

 

 

posted @ 2012-11-22 14:47  einyboy  阅读(1175)  评论(1编辑  收藏  举报