Note: The other languages of the website are Google-translated. Back to English
Log in  \/ 
x
or
x
Register  \/ 
x

or

How to create qr code based on cell value in Excel?

Do you know how to create QR code based on specific cell value in Excel? This article will show you a method to achieve it in details.

Create QR code based on cell value with Barcode Control and VBA code
Easily create multiple QR codes in bulk based on cell values with an amazing tool


Create QR code based on cell value with Barcode Control and VBA code

The Barcode Control can help you quickly create QR code based on cell value in Excel. Please do as follows.

1. Open the worksheet contains the cell value you will create QR Code based on.

2. Click Developer > Insert > More Control. See screenshot:

3. In the More Controls window, check for the Microsoft Barcode Control 16.0 or Microsoft Barcode Control 15.0.

4. If you didn’t find the Barcode Control in the More Controls window or the Barcode Control does not the 16.0 or 15.0, you need to download the barcode control file by clicking this links: download barcode control. If there is Barcode Control 16.0 or 15.0 in your More Controls window, just jump to below step 10.

After downloading the file, unzip it and then update the Barcode Control with the downloaded barcode control in your Excel as follows.

5. Close all your Excel workbooks, go to the Start section, find the Excel app and right click on it, then select Run as administrator from the context menu. See screenshot:

6. In the opening User Account Control dialog box, click the Yes button.

7. Then a new workbook is created. Please click Developer > Insert > More Control. See screenshot:

8. In the More Controls window, click Register Custom button, find and select one of the downloaded qr code OCX file and then click the Open button. See screenshot:

9. Click the OK button when it returns the More Controls window to finish the Barcode Control updated. Then reopen the workbook contains the cell values you will create QR Codes based on.

10. Right click the sheet tab and click View Code from the context menu to open the Microsoft Visual Basic for Applications window. Then copy and paste below VAB code into the Code window. And finally press the Alt + Q keys to exit the Microsoft Visual Basic for Applications window.

VBA code: Create QR code in Excel

Sub setQR()
'Updated by Extendoffice 2018/8/22
    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", "Kutools for Excel", , , , , , 8)
    If xSRg 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 = xSRg.Text
    ActiveSheet.Shapes.Item(xObjOLE.Name).Copy
    ActiveSheet.Paste xRRg
    xObjOLE.Delete
    Application.ScreenUpdating = True
End Sub

11. Click Developer > Insert > Button (Form Control) as below screenshot shown.

12. Draw a button into current worksheet. In the popping up Assign Macro dialog, select setQR in the box and then click the OK button.

13. Turn off the Design Mode by clicking Developer > Design Mode.

14. Click the button, in the opening Kutools for Excel dialog, select the cell you will create QR Code based on and click OK.

15. In the second Kutools for Excel dialog, select a cell to place the QR Code. See screenshot:

Then the QR Code will be inserted into specified cell immediately. Repeat step 14 to 15 to finish all QR Code created. See screenshot:


Easily create multiple QR codes in bulk based on cell values with an amazing tool

To be honest, the above method is not easy to handle as it has its own limitation. Here highly recommended the Insert QR Code feature of Kutools for Excel. This feature can help you quickly insert QR codes in bulk based on specified cell values in Excel with several clicks only. Please do as follows to get it done.

Before applying Kutools for Excel, please download and install it firstly.

1. Firstly, prepare your values that you want to create QR code based on.

2. Click Kutools > Insert > Insert QR Code.

Tips: If you can’t find the feature with this path, please press the Alt + S keys simultaneously to open the Search Kutools Functions box, manually type QR Code in the search box, then you can see the Insert QR Code feature is listed out, just click to activate the feature. See screenshot:

Now the Insert QR Code pane is displayed on the right side of the workbook.

3. In the Insert QR Code pane, you need to configure as follows.

3.1) In the Data Range box, select the range of cells containing the values you want to create QR Code based on;
3.2) In the Insert Range box, select a range of blank cells to output the QR code;
3.3) In the Options section, configure the size, line color, background color and Error Correction level for the QR code as you need;
Note: The size of the QR code cannot exceed 500 pixels.
3.4) Click the Generate button. See screenshot:

4. Then a Kutools for Excel dialog box pops up, click OK.

5. Then the QR codes are created at the same time. You need to manually close the Insert QR Code pane if finish creating all QR codes.

Click to know more about this feature...


Related article:


The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Lucas Roberto · 3 months ago
    Olá! Para mim, nenhum dos comentários ou esse post funcionou corretamente, mas utilizando o Visual Basic com o código que deixarei abaixo funcionou, pois criou uma função para mim. E para usar a função é só abrir a planilha e digitar: "=QrCode("célula desejada")"





    Function QrCode(codetext As String)
    Dim URL As String, MyCell As Range
    'Para gerar o código, precisa a máquina ter acesso a internet
    Set MyCell = Application.Caller
    URL = "https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=" & codetext
    On Error Resume Next
    ActiveSheet.Pictures("QR_" & MyCell.Address(False, False)).Delete
    On Error GoTo 0
    ActiveSheet.Pictures.Insert(URL).Select
    With Selection.ShapeRange(1)
    .PictureFormat.CropLeft = 15
    .PictureFormat.CropRight = 15
    .PictureFormat.CropTop = 15
    .PictureFormat.CropBottom = 15
    .Name = "QR_" & MyCell.Address(False, False)
    .Left = MyCell.Left + 2
    .Top = MyCell.Top + 2
    End With
    QrCode = ""
    End Function
  • To post as a guest, your comment is unpublished.
    Jörg · 3 months ago
    Wie lösche ich die QR Code Grafik wieder ? wenn ich mit den Skript Wie erstelle ich einen QR-Code basierend auf dem Zellenwert in Excel? einen QR Code erzeugt habe ?

  • To post as a guest, your comment is unpublished.
    ChavdarHarchev · 4 months ago
    Hi All,

    I modified the VBA code for creation a multi QR codes from selection in excel column

    Follow until step 10 then add this code

    Sub setQR()

       Dim xSRg As Range
       Dim xRRg As Range
       Dim xObjOLE As OLEObject
      On Error Resume Next
       Dim srcSelection As Range
       Dim srcCell As String
    For Each srcSelection In Application.Selection
       Dim qrCelltoupdate As String
       Dim qrTxt As String
       qrCelltoupdate = srcSelection.Offset(0, 1).Address
       qrTxt = srcSelection.Text
       Worksheets("Sheet1").Range(qrCelltoupdate).Select
       Application.ScreenUpdating = False
       Set xObjOLE = ActiveSheet.OLEObjects.Add("BARCODE.BarCodeCtrl.1")
       xObjOLE.Object.Style = 11
       xObjOLE.Object.Value = qrTxt
       ActiveSheet.Shapes.Item(xObjOLE.Name).Copy
     ActiveSheet.Paste
     xObjOLE.Delete
     Next srcSelection
      'Create Qr code from selection multi cells
    End Sub


    In step 12
    Assign Macro
    Chose: Sheet1.setQR

    QR codes will be populated in next column

    Hope that helps for you all 
    • To post as a guest, your comment is unpublished.
      Pierre Galuszka · 4 months ago
      Hi ChavdarHarchev.

      First of all thank You very much for Your nice work.

      Is it possible for You to show how the VBA code looks like when it is finished?

      Best regards

      Pierre Galuszka.
  • To post as a guest, your comment is unpublished.
    Chavdar · 4 months ago
    Hi All,

    I modified the VBA code for creation a multi QR codes from selection in excel column 

    Follow until step 10 then add this code 

    Sub setQR()

    Dim xSRg As Range
    Dim xRRg As Range
    Dim xObjOLE As OLEObject
    On Error Resume Next
    Dim srcSelection As Range
    Dim srcCell As String
    For Each srcSelection In Application.Selection
    Dim qrCelltoupdate As String
    Dim qrTxt As String
    qrCelltoupdate = srcSelection.Offset(0, 1).Address
    qrTxt = srcSelection.Text
    Worksheets("Sheet1").Range(qrCelltoupdate).Select
    Application.ScreenUpdating = False
    Set xObjOLE = ActiveSheet.OLEObjects.Add("BARCODE.BarCodeCtrl.1")
    xObjOLE.Object.Style = 11
    xObjOLE.Object.Value = qrTxt
    ActiveSheet.Shapes.Item(xObjOLE.Name).Copy
    ActiveSheet.Paste
    xObjOLE.Delete
    Next srcSelection
    'Create Qr code from selection multi cells
    End Sub


    In step 12 
    Assign Macro 
    Chose: Sheet1.setQR

    QR codes will be populated in next column 

    Hope that helps for you all 
  • To post as a guest, your comment is unpublished.
    Mayank Kumar · 8 months ago
    I didn't have "Microsoft Barcode Control 16.0" so I down loaded per instruction. And open Excel with Admin mode. Then try to "Register Custom" . But I opened Barcode control folder and select MSBCODE964,OCX. Then there is error message came out. It said "The selected file does not contain self-registrating ActiveX control". What it means? What is the problem. And how can I install that?
    • To post as a guest, your comment is unpublished.
      ChavdarHarchev · 4 months ago
      1)Click File > Options.

      2)Click Trust Center > Trust Center Settings > ActiveX Settings.

      Click the options below, and then click OK.

       * Enable all controls without restrictions and without prompting (not recommended)
       
      3)Click Ok 
  • To post as a guest, your comment is unpublished.
    oom · 1 years ago
    how to make qr code with many field for one qr?
    • To post as a guest, your comment is unpublished.
      ChavdarHarchev · 4 months ago
      you need to merge all cells into one cell then use that info to create QR code 
  • To post as a guest, your comment is unpublished.
    Daniel · 1 years ago
    Hello

    I just installed Kutool program to make QR code from Excel. I will test this program and if it works then I will purchaSE IT.

    I didn't have "Microsoft Barcode Control 16.0" so I down loaded per instruction. And open Excel with Admin mode. Then try to "Register Custom" . But I opened Barcode control folder and select MSBCODE964,OCX. Then there is error message came out. It said "The selected file does not contain self-registrating ActiveX control". What it means? What is the problem. And how can I install that?

    Please let me know how to solve the problem.

    Thanks

    Daniel Park
  • To post as a guest, your comment is unpublished.
    Helton · 1 years ago
    Can I change the QR code size? Not manually, but paste the selected size?
  • To post as a guest, your comment is unpublished.
    VinRoo · 1 years ago
    It helps to solve my BIG problem! THANK YOU!!!!
  • To post as a guest, your comment is unpublished.
    Bobby Lee · 1 years ago
    If i use the download file. Is this free of company? or only free of person?
  • To post as a guest, your comment is unpublished.
    Michel S · 2 years ago
    Does anyone know how to print the generated QR codes once they are created? After creating said code you aren't able to select them unless you switch to "designer mode" and even then you are only able to get into properties or format object. There is a checkbox for a "print object" under the format object selection but haven't been able to actually print the code itself. Any help would be appreciated.

    Thanks!
  • To post as a guest, your comment is unpublished.
    mitterkit@gmail.com · 2 years ago
    when register custom : error the select file dies not contain any self-registering ActiveX controls
  • To post as a guest, your comment is unpublished.
    Sryx43 · 2 years ago
    Hello,
    Is it possible to link a QR Code to the value of a cell in an online Excel spreadsheet ? Meaning that if one would edit the value of the cell, the QR Code would give the edited value of the cell ?
    Thank you
  • To post as a guest, your comment is unpublished.
    Fred · 2 years ago
    wie kann ich die Grösse der QR Code ändern oder wieder löschen?
  • To post as a guest, your comment is unpublished.
    James · 2 years ago
    Can you create a QR code from information across multiple cells? Anytime I do this I get a blank insert
  • To post as a guest, your comment is unpublished.
    Deaw215 · 2 years ago
    This one is great but I need to do more than 4K QR, so Could you please suggest to do by batch?
  • To post as a guest, your comment is unpublished.
    eric tan · 2 years ago
    how to run it without administrator right?
  • To post as a guest, your comment is unpublished.
    bayu · 2 years ago
    msbcode not found
    • To post as a guest, your comment is unpublished.
      crystal · 2 years ago
      Hi bayu,
      Some mistake for the link, fix now. Sorry for the inconvenience.
  • To post as a guest, your comment is unpublished.
    arthur · 2 years ago
    Microsoft Barcode Control 16.0 tidak nge-link..minta dong pak
  • To post as a guest, your comment is unpublished.
    Augusto · 2 years ago
    no puedo descargar Microsoft Barcode Control 16.0
  • To post as a guest, your comment is unpublished.
    febrian · 2 years ago
    MSBCODE.zip error 404 not found
    please reupload
  • To post as a guest, your comment is unpublished.
    diego · 2 years ago
    prezados, preciso de A1:A5 em um único QR, é possivel?
  • To post as a guest, your comment is unpublished.
    شاهین · 2 years ago
    سلام لینک دانلود کارنمیکنه
  • To post as a guest, your comment is unpublished.
    vo hong minh · 2 years ago
    Khong the tai duoc Microsoft Barcode Control 16.0 admin oi