By: Mashhura

In reply to Mark.

Hey MARK,
Thanks for your comment. I am replying to you on behalf of ExcelDemy. For the provided practice workbook, I used the following VBA code and it solved this problem for me.

Function QR_Generator(qrcodes_values As String)

Dim Site_URL As String
Dim Cell_Values As Range

Set Cell_Values = Application.Caller
Site_URL = "https://chart.googleapis.com/chart?chs=100x100&&cht=qr&chl=" & qrcodes_values
On Error Resume Next
Worksheets("Using User Defined Function").Pictures("Generated_QR_CODES_" & Cell_Values.Address(False, False)).Delete
On Error GoTo 0
Worksheets("Using User Defined Function").Pictures.Insert(Site_URL).Select
With Selection.ShapeRange(1)
.Name = "Generated_QR_CODES_" & Cell_Values.Address(False, False)
.Left = Cell_Values.Left + 2
.Top = Cell_Values.Top + 2
End With
QR_Generator = ""

End Function

Now, Save the code and go back to your worksheet. Let’s see the steps of using the function.
Step-01: Select the cells where you want the QR Codes. Here, I selected cell range D5:D7 >> write the following formula.
=QR_Generator(C5)

Step-02: Press Ctrl + Enter and you will get your desired output.

I hope this will help you to solve your problem. Please let me know if you have other queries.
Regards
Mashhura,
ExcelDemy.