Sub setQR()
'Updated by Extendoffice 2018/8/22
Dim xSRg As Range, xSRg1 As Range
Dim xRRg As Range
Dim xObjOLE As OLEObject
On Error Resume Next
Set xSRg = Application.InputBox("Please select the cell you will create QR code based on Firstname", "Kutools for Excel", , , , , , 8)
Set xSRg1 = Application.InputBox("Please select the cell you will create QR code based on Name", "Kutools for Excel", , , , , , 8)
If xSRg Is Nothing And xSRg1 Is Nothing Then Exit Sub
Set xRRg = Application.InputBox("Select a cell to place the QR code", "Kutools for Excel", , , , , , 8)
If xRRg Is Nothing Then Exit Sub
Application.ScreenUpdating = False
Set xObjOLE = ActiveSheet.OLEObjects.Add("BARCODE.BarCodeCtrl.1")
xObjOLE.Object.Style = 11
xObjOLE.Object.Value = "Firstname " & xSRg.Text & vbCrLf & "Name " & xSRg1.Text
ActiveSheet.Shapes.Item(xObjOLE.Name).Copy
ActiveSheet.Paste xRRg
xObjOLE.Delete
Application.ScreenUpdating = True
End Sub