Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

Sub setQR()

'Updated by Comtutor
Dim xSRg 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", "Comtutor QR Code", , , , , , 8)
If xSRg Is Nothing Then Exit Sub
Set xRRg = Application.InputBox("Select a cell to place the QR code", "Comtutor
QR Code", , , , , , 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 = xSRg.Text
ActiveSheet.Shapes.Item(xObjOLE.Name).Copy
ActiveSheet.Paste xRRg
xObjOLE.Delete
Application.ScreenUpdating = True
End Sub

You might also like