You are on page 1of 1

=EncodeBarcode(CELL("SHEET");CELL("ADDRESS");A2;51;1;0;2)

' Keterangan :
' CELL("SHEET");CELL("ADDRESS") => ini biarkan seperti ini
' A2 => Cell dimana isi text yang akan diubah ke QR
' 51 => untuk QR Code
0-Code128,
1-EAN,
2-2of5I,
3-Code39,
50-Datamatrix,
51-QR Code
' 1 => Output ( 1 Gambar | 0 Font)
' 0 => Parameter
' 2 => Zone ID

online

Function Buat_QR(codetext As String)


Rem Auth:Excelnoob.com
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

'Hapus jika sebelumnya sudah ada QRCode


ActiveSheet.Pictures("MyQR_" & 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 = "MyQR_" & MyCell.Address(False, False)
.Left = MyCell.Left + 25
.Top = MyCell.Top + 5
End With
Buat_QR = "" ' atau boleh masukan Text
End Function

You might also like