How to create a GUID in Excel ?

How to create a GUID in Excel ?

Asked on January 11, 2019 in Excel.
Add Comment


  • 4 Answer(s)

    The below function in v.2013 excel vba macro code, to create a GUID in Excel :

    Public Function GetGUID() As String
        GetGUID = Mid$(CreateObject("Scriptlet.TypeLib").GUID, 2, 36)
    End Function
    
    Answered on January 11, 2019.
    Add Comment

    Use this following solution : 

        The latest version of Excel, there is the syntax along commas, but not semicolons.

    =CONCATENATE(DEC2HEX(RANDBETWEEN(0,4294967295),8),"-",DEC2HEX(RANDBETWEEN(0,42949),4),"-",DEC2HEX(RANDBETWEEN(0,42949),4),"-",DEC2HEX(RANDBETWEEN(0,42949),4),"-",DEC2HEX(RANDBETWEEN(0,4294967295),8),DEC2HEX(RANDBETWEEN(0,42949),4))
    

    Otherwise we can go for lower-cased according to this.

    =LOWER(CONCATENATE(DEC2HEX(RANDBETWEEN(0,4294967295),8),"-",DEC2HEX(RANDBETWEEN(0,42949),4),"-",DEC2HEX(RANDBETWEEN(0,42949),4),"-",DEC2HEX(RANDBETWEEN(0,42949),4),"-",DEC2HEX(RANDBETWEEN(0,4294967295),8),DEC2HEX(RANDBETWEEN(0,42949),4)))
    
    Answered on January 11, 2019.
    Add Comment

    Try this alternative solution :

    =CONCATENATE(
       DEC2HEX(RANDBETWEEN(0;4294967295);8);"-";
       DEC2HEX(RANDBETWEEN(0;42949);4);"-";
       DEC2HEX(RANDBETWEEN(0;42949);4);"-";
       DEC2HEX(RANDBETWEEN(0;42949);4);"-";
       DEC2HEX(RANDBETWEEN(0;4294967295);8);
       DEC2HEX(RANDBETWEEN(0;42949);4)
    )
    
    Answered on January 11, 2019.
    Add Comment

    By using the following function in v.2013 excel vba macro code

    Public Function GetGUID() As String
    GetGUID = Mid$(CreateObject(“Scriptlet.TypeLib”).GUID, 2, 36)
    End Function

    Answered on February 5, 2019.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.