How can I generate GUIDs in Excel?

前端 未结 11 1012
别那么骄傲
别那么骄傲 2020-11-27 14:58

I have an excel file with one order on each row, and I want each order to have a unique identifier, so there will be a Unique ID column. Every time I fill a row, I want Exce

11条回答
  •  Happy的楠姐
    2020-11-27 15:51

    Function funGetGuid() As String
    
        Const URL As String = "http://www.guidgen.com/"
        Const strMask As String = "value="
    
        Dim l As Long
        Dim txt As String
    
        With CreateObject("MSXML2.XMLHTTP")
            .Open "GET", URL, False
            .send
            txt = .responseText
        End With
    
        Do
            l = InStr(l + 1, txt, strMask)
            If l = 0 Then Exit Do
            funGetGuid = Mid$(txt, l + Len(strMask) + 1, 36)
        Loop
    
    End Function
    

提交回复
热议问题