1
I would like to form a MAC address from the data collected from a barcode reader. I need every two characters to be added one "-".
Entry text: A9B8C7D6E5F4
Output text: A9-B8-C7-D6-E5-F4
So far I have reached the next point of attempted resolution:
Function MACADddress(macaddress As String) As String
Dim i As Integer
Dim C As Integer
Set C = 0
Dim k As Integer
Set k = macaddress.lenght
Dim NewMac As String
Set NewMac = ""
For i = 0 To k
C = C + 1
If C = 2 Then
NewMac = NewMac & macaddress(i) & "-"
C = 0
Else
NewMac = NewMac & macaddress(i)
End If
MsgBox (NewMac)
Next i
MACADddress = NewMac
End Function
Daniel, thank you very much. It worked right here!
– Luis Alberto Batista