How to Create QR Codes in Excel?

Quick Response (QR) codes can be used in Excel to share information or to access data stored in an Excel spreadsheet quickly. However, Excel does not have a built-in feature to create QR codes.

Still, you can use various techniques, such as an add-in, to generate QR codes and insert them into Excel.

What is a QR Code?

A QR code (short for “Quick Response code”) is a two-dimensional barcode that contains information that can be read via a smartphone or other QR code reader.

An example of a QR code image is shown below:

Example of a QR code

The QR code consists of black and white squares arranged in a specific pattern that can be scanned by the reader, which then decodes the information stored in the code.

The information stored in the QR code can include a wide range of data, such as website URLs, contact information, text, and more.

QR codes are commonly used in marketing and advertising, as well as in retail and manufacturing, for inventory tracking and management.

This tutorial shows four techniques for creating a QR code in Excel.

Method #1: Using IMAGE Function to Create QR Codes in Excel

The IMAGE function, only available in Excel 365, returns an image from a given source. We can utilize the function to create a QR code image in Excel.

Assume we have the following dataset showing various URLs:

Urls to create QR code

We want to apply the IMAGE function in column B to return to QR codes of the URLs displayed in column A.

We use the steps below:

  1. Copy the formula below and paste it into cell B2:
IMAGE formula inserts QR code in cell
  1. Click Enable on the Microsoft Excel Security Notice dialog box that appears (in case it appears):
Click the enable button
  1. Drag or double-click the fill handle feature in cell B2 to copy the formula down the column:
QR Code generated for all cells

We now have QR codes in our Excel worksheet that can be easily scanned using a QR code reader app on a mobile device.

Explanation of the Formula


This formula generates a QR code image using the Google Chart API with the URL in cell A2.

Here is the breakdown of the formula:

  1. =IMAGE( This is the start of the formula indicating that you want to display an image in the cell.
  2. “×100&&cht=qr&chl=” is the link to the Google Chart API service that produces QR codes. The “chs” parameter specifies the QR code size (100×100 pixels), while the “cht” parameter indicates the chart type (QR code). The content of the QR code is specified through the “chl” parameter.
  3. “&A2)” The value in cell A2 is joined to the end of the URL, passing it as the content (or data) for the QR code. 

Method #2: Using an Add-in to Create QR Codes in Excel

We can use various add-ins, for example, QR4Office, to create and insert a QR code into Excel.

For this article, I will use the QR4Office add-in and explain how to use it to insert QR codes in Excel.

Let’s consider the following dataset showing various URLs.

Urls to create QR code

We want to use the QR4Office add-in to generate a QR code for each URL and display it in the corresponding cell in column B.

Below are the steps to generate QR codes using the add-in:

Step #1: Insert the QR4Office Add-in into Excel

Use the steps below to insert the QR4Office add-in into Excel:

  1. On the Insert tab, open the Add-ins drop-down and choose the Get Add-ins option.
Click on the get add ins option
  1. On the Office Add-ins dialog box, enter the search term “qr4office” on the search box. When the QR4Office add-in appears on the list, click the Add button.
Search for the qr4office add in
  1. Click Continue on the dialog box that pops up.
Click on continue for QR4 office add in
  1. The QR4Office add-in is installed, and its task pane is displayed on the right of the Excel window.
QR4 office add in is installed

Note: When you open the ‘Enter URL/text you’d like to encode’ drop-down on the task pane, you see the data types you can encode using the add-in.

Select the data type from the Dropdown

Step #2: Use the QR4Office Task Pane to Generate QR Codes

Use the below steps to generate the QR codes for the dataset’s URLs:

  1. Select cell A2 containing the first URL and press Ctrl + C to copy it.
  2. Paste the URL onto the “Enter the URL/text you’d like to encode” box:
Paste the URL in the Enter the URL/text you’d like to encode box

Notice the preview of the QR code on the Preview box of the task pane.

  1. Use the options on the task pane’s Options group to change the QR code’s size and color. In this example, we stick with the default settings.
  2. Select cell B2 and click the Insert button at the bottom of the task pane.

The QR code is inserted into cell B2. You can resize it and position it in the cell as needed.

QR code for the URL inserted in Cell B2
  1. Repeat steps 1-4 to insert QR codes for the rest of the URLs.
repeat the steps to insert QR codes for all the urls
  1. Save the worksheet.

Now you have QR codes in your Excel worksheet that can be scanned by a QR code reader app on a mobile device.

Also read: How to Create Barcodes in Excel

Method #3: Using QR Code Generator Website to Create QR Codes in Excel

You can use QR code generator websites such as,, or to create QR codes and insert them into Excel.

In this tutorial, we shall use in our illustration.

Suppose we have the following Excel dataset showing the URLs of particular organizations.

Urls to create QR code

We want to use the QR code generator website,, to create QR codes for the URLs and display them in column B.

Below are the steps to do this:

  1. Open a web browser and go to the QR code generator website,
Open the QR code generator website
  1. Select cell A2 and press Ctrl + C to copy the website URL.
  2. Enter the URL in the generator and customize the desired size, color, and other settings.
Customize the QR code

Notice the generated QR code preview on the right of the screen.

  1. Click the green Download button on the right of the website window to download the image file to your computer.
  2. Open your Excel worksheet and select cell B2 where you want to insert the QR code.
  3. On the Insert tab, open the Illustrations, then the Pictures drop-downs, and choose This Device.
Insert picture from this device
  1. Browse to the location where you saved the QR code image file, select the file, and click Insert.
Select the QR code file
  1. Resize and position the QR code image within the cell.
QR code has been inserted into the cell
  1. Repeat steps 2-8 to generate and insert QR codes for the rest URLs.
repeat the steps to insert QR codes for all the urls
  1.  Save your Excel worksheet.

Now you have created QR codes in your Excel spreadsheet that can be scanned by a QR code reader app on a mobile device.

Method #4: Using a User-Defined Function to Create QR Codes in Excel

We can use Excel VBA to create a User Defined Function that we can apply in creating QR codes in Excel.

We have the following dataset showing the URLs of particular organizations:

Urls to create QR code

We want to create and use a User Defined Function to generate QR codes for the URLs.

We use the following steps:

  1. Press the shortcut Alt + F11 to open the Visual Basic Editor.
  2. Open the Insert menu and choose Insert to create a module in the Visual Basic Editor.
Insert a new module
  1. Copy the following function procedure and paste it into the module:
'Code developed by Steve Scott from
Function QRCODEGENERATOR(QrCodeValues As String)
Dim URL As String
Dim CellValues As Range
Set CellValues = Application.Caller
URL = "" & QrCodeValues
On Error Resume Next
ActiveSheet.Pictures("Generated_QR_CODES_" & CellValues.Address(False, False)).Delete
On Error GoTo 0
With Selection.ShapeRange(1)
    .Name = "Generated_QR_CODES_" & CellValues.Address(False, False)
    .Left = CellValues.Left + 2
    .Top = CellValues.Top + 2
End With
End Function
  1. Save the workbook as an Excel Macro-Enabled Workbook (*.xlsm).
  2. Press the shortcut Alt + F11 to switch to the active worksheet containing the dataset.
  3. Select the cell range B2:B6:
Select the range where you want the QR codes
  1. Type the following formula in the active cell of the selected cell range:
Enter the QR code generator custom formula
  1. Press Ctrl + Enter to enter the formula.

The QR codes for the URLs are generated:

QR code generated using VBA

This code would generate QR codes that are all the same size (we specified the size in our code). So you need to ensure that your cells are big enough so that the QR code is placed in them.

Explanation of the User-Defined Function

  1. The UDF is named QRCODEGENERATOR and takes one input parameter, QrCodeValues, which is the string value to be encoded in the QR code.
  2. Two variables are declared: URL and CellValues. URL stores the URL for the Google Chart API, which will generate the QR code image. CellValues is used to store a reference to the cell range that called the UDF.
  3. Application.Caller is used to set the CellValues variable to the reference to the range of cells that called the UDF. This process lets the UDF know where to insert the generated QR code image.
  4. The URL variable is then constructed using the input parameter QrCodeValues and the Google Chart API URL.
  5. On Error Resume Next is used to suppress any error messages that may occur when trying to delete an existing QR code image from the worksheet.
  6. If a QR code exists in the cell range, it is deleted using the ActiveSheet.Pictures(“Generated_QR_CODES_” & CellValues.Address(False, False)).Delete statement.
  7. On Error GoTo 0 is used to turn off error handling.
  8. The ActiveSheet.Pictures.Insert(URL) statement inserts the QR code image into the worksheet.
  9. The With Selection.ShapeRange(1) statement selects the newly inserted QR code image and sets some properties. The Name property is set to a unique name based on the cell that called the UDF. The Left and Top properties are set to position the QR code image next to the cell that called the UDF.
  10.  The QRCODEGENERATOR function returns an empty string, which is not used for anything.

In this tutorial, I’ve covered three methods you can use to generate QR codes in Excel.

The easiest way would be to use and add in such as QR4Office or an external website such as, however, you will have to generate these QR codes one by one.

In case you want to generate a lot of QR codes in one go, you can use the VBA method covered in this tutorial.

Other Excel articles you may also like:

I am a huge fan of Microsoft Excel and love sharing my knowledge through articles and tutorials. I work as a business analyst and use Microsoft Excel extensively in my daily tasks. My aim is to help you unleash the full potential of Excel and become a data-slaying wizard yourself.

1 thought on “How to Create QR Codes in Excel?”

Leave a Comment