YansaneYansane
New Member
- Joined
- Nov 1, 2024
- Messages
- 22
- Office Version
- 2019
- Platform
- Windows
- Web
Hi ,QR codes require URL links. I don't see any in your picture.
Function GETQRCODES(QrCodeValues As String)
Dim URL As String
Dim CellValues As Range
Set CellValues = Application.Caller
URL = "https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=" & QrCodeValues
On Error Resume Next
ActiveSheet.Pictures("Generated_QR_CODES_" & CellValues.Address(False, False)).Delete
On Error GoTo 0
ActiveSheet.Pictures.Insert(URL).Select
With Selection.ShapeRange(1)
.Name = "Generated_QR_CODES_" & CellValues.Address(False, False)
.Left = CellValues.Left + 2
.Top = CellValues.Top + 2
End With
GETQRCODES = ""
End Function
=GETQRCODES(TEXTJOIN("|",,B2:I2))
Hi Cubist,I'm guessing you wan't to store the info under a QR code. It's typically used for a URL. Here's a sample VBA function. It stores the info separated by the pipe "|" symbol.
VBA Code:Function GETQRCODES(QrCodeValues As String) Dim URL As String Dim CellValues As Range Set CellValues = Application.Caller URL = "https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=" & QrCodeValues On Error Resume Next ActiveSheet.Pictures("Generated_QR_CODES_" & CellValues.Address(False, False)).Delete On Error GoTo 0 ActiveSheet.Pictures.Insert(URL).Select With Selection.ShapeRange(1) .Name = "Generated_QR_CODES_" & CellValues.Address(False, False) .Left = CellValues.Left + 2 .Top = CellValues.Top + 2 End With GETQRCODES = "" End Function
Usage:
Excel Formula:=GETQRCODES(TEXTJOIN("|",,B2:I2))
View attachment 120365