You could try the machines serial number using this Function. It will work on Mac or PC
Function GetPCSerialNumber()
' V1.1
#If Mac Then
Dim PCSerialNumber, StrOffset
PCSerialNumber = MacScript("do shell script ""ioreg -l | grep IOPlatformSerialNumber""")
StrOffset = InStr(PCSerialNumber, " = """)
PCSerialNumber = Mid(PCSerialNumber, StrOffset + 4, 999)
GetPCSerialNumber = "{Mac}" & Left(PCSerialNumber, Len(PCSerialNumber) - 1)
#Else
' wmic bios get * /format:list
Dim objWMIService As Object
Dim colItems As Variant
Dim objItem
Dim strMsg As String
Set objWMIService = GetObject("winmgmts://./root/cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS where PrimaryBIOS = true", , 48)
For Each objItem In colItems
strMsg = objItem.SerialNumber
Next
GetPCSerialNumber = strMsg
#End If
You could also use Excel's own function [in VBA] ENVIRON(), to get the values of [PC] environment variables e.g. ENVIRON("USERNAME") or ENVIRON("COMPUTERNAME"), you could access this in Excel by creating another function GETENVIRON():
Function GetEnviron(ByVal EnvironmentVariableName As String)
' V1.1
GetEnviron = Environ(EnvironmentVariableName)
End Function
Note that on a Mac, the equivalent of a PC's USERNAME environment variable is USER or LOGNAME.
On a Mac there are far less environment variables of use (Try ENV in a Terminal windows to see)