0% found this document useful (0 votes)
182 views1 page

Scrip Buat QR Code

This VBA function inserts a QR code image into a cell on a worksheet from a given codetext string. It deletes any existing QR code image in that cell, inserts a new image from a Google Chart URL using the codetext, sizes and positions the image slightly larger than the cell, and returns an empty string.

Uploaded by

aprast
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
182 views1 page

Scrip Buat QR Code

This VBA function inserts a QR code image into a cell on a worksheet from a given codetext string. It deletes any existing QR code image in that cell, inserts a new image from a Google Chart URL using the codetext, sizes and positions the image slightly larger than the cell, and returns an empty string.

Uploaded by

aprast
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Function Bank_OPS_QR(codetext As String)

Dim URL As String, MyCell As Range

Set MyCell = Application.Caller


URL = "https://chart.googleapis.com/chart?chs=125x125&cht=qr&chl=" & codetext
On Error Resume Next
ActiveSheet.Pictures("My_QR_" & MyCell.Address(False, False)).Delete 'delete if
there is prevoius one
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 = "My_QR_" & MyCell.Address(False, False)
.Left = MyCell.Left + 5
.Top = MyCell.Top + 5
End With
Bank_OPS_QR = "" ' or some text to be displayed behind code
End Function

You might also like