Ruy2021
01-05-2021 01:30:22
Boa noite.
Gostaria de alterar a função abaixo para executar através de um botão, é possível?
A planilha está em anexo, obrigado pela ajuda.
Function QrCode(codetext As String)
'DESABILITA ATUALIZAÇÃO DE TELA
Application.ScreenUpdating = False
Dim URL As String, MyCell As Range
Set MyCell = Application.Caller
'SINTAXE E PARÂMETROS DA URL:
'
' chs= <width>x<height>: define o tamanho da imagem, largura x altura _
' | (ideal que seja de no mínimo 100x100 pixels)
' |
' | cht=qr: especifica o tipo QR code
' | |
' URL base (fixa) | | chl=<data>: dado, texto que será codificado
' _________________|________________ ____|____ __|__ ______|_______
' | || || | | |
URL = "https://chart.googleapis.com/chart?chs= ... ht=qr&chl=" & codetext
On Error Resume Next
'Apaga a imagem anterior, se houver
ActiveSheet.Pictures("QR_" & MyCell.Address(False, False)).Delete
On Error GoTo 0
ActiveSheet.Pictures.Insert(URL).Select
With Selection.ShapeRange(1)
.PictureFormat.CropLeft = 12
.PictureFormat.CropRight = 12
.PictureFormat.CropTop = 12
.PictureFormat.CropBottom = 12
.Name = "QR_" & MyCell.Address(False, False)
.Left = MyCell.Left - 40
.Top = MyCell.Top - 30
End With
QrCode = ""
End Function
Gostaria de alterar a função abaixo para executar através de um botão, é possível?
A planilha está em anexo, obrigado pela ajuda.
Function QrCode(codetext As String)
'DESABILITA ATUALIZAÇÃO DE TELA
Application.ScreenUpdating = False
Dim URL As String, MyCell As Range
Set MyCell = Application.Caller
'SINTAXE E PARÂMETROS DA URL:
'
' chs= <width>x<height>: define o tamanho da imagem, largura x altura _
' | (ideal que seja de no mínimo 100x100 pixels)
' |
' | cht=qr: especifica o tipo QR code
' | |
' URL base (fixa) | | chl=<data>: dado, texto que será codificado
' _________________|________________ ____|____ __|__ ______|_______
' | || || | | |
URL = "https://chart.googleapis.com/chart?chs= ... ht=qr&chl=" & codetext
On Error Resume Next
'Apaga a imagem anterior, se houver
ActiveSheet.Pictures("QR_" & MyCell.Address(False, False)).Delete
On Error GoTo 0
ActiveSheet.Pictures.Insert(URL).Select
With Selection.ShapeRange(1)
.PictureFormat.CropLeft = 12
.PictureFormat.CropRight = 12
.PictureFormat.CropTop = 12
.PictureFormat.CropBottom = 12
.Name = "QR_" & MyCell.Address(False, False)
.Left = MyCell.Left - 40
.Top = MyCell.Top - 30
End With
QrCode = ""
End Function