Function macplus1(mac) ' 'Freeware von Johannes Bergsmann 'Benützen sie das Programm, aber lassen sie den Autornamen drin ' 'Mac ist geteilt '6 Ziffern fix für Hersteller '6 Ziffern für Gerät ' ' Fragezeichen als Eingabe bringt Kurzanleitung ' If mac = "?" Then macplus1 = "6 Ziffern für Hersteller, 6 für Gerät, Gerätenummer wird hochgezählt" Exit Function End If ' If mac = "xx-xx-xx-yy-yy-yy" Then macplus1 = "6 Ziffern für Hersteller, 6 für Gerät, Gerätenummer wird hochgezählt" Exit Function End If ' l = Len(mac) If l <> 17 Then macplus1 = "xx-xx-xx-yy-yy-yy" Exit Function End If ' hersteller = Left(mac, 9) hersteller = UCase(hersteller) mac = Right(mac, 8) ' plainmac = "" For i = 1 To l If Mid(mac, i, 1) <> "-" Then plainmac = plainmac + Mid(mac, i, 1) Next ' plainmac = UCase(plainmac) ' ziffern = "0123456789ABCDEF" ' Dim dezmac As Long dezmac = 0 l = Len(plainmac) For i = 1 To l For j = 0 To 15 If Mid(plainmac, i, 1) = Mid(ziffern, j + 1, 1) Then dezmac = dezmac * 16 dezmac = dezmac + j Exit For End If Next j Next i ' dezmac = dezmac + 1 ' plainmac = "" For i = 1 To l ziffernwert = dezmac - (dezmac \ 16) * 16 plainmac = Mid(ziffern, ziffernwert + 1, 1) + plainmac dezmac = dezmac \ 16 Next i ' l = Len(plainmac) mac = Right(plainmac, 2) For i = 3 To l If (i \ 2) * 2 < i Then mac = "-" + mac mac = Mid(plainmac, 1 + l - i, 1) + mac Next ' macplus1 = hersteller + mac End Function l = Len(plainmac) mac = Right(plainmac, 2) For i = 3 To l If (i \ 2) * 2 < i Then mac = "-" + mac mac = Mid(plainmac, 1 + l - i, 1) + mac Next ' macplus1 = hersteller + mac End Function