Sub QRCODEBureau(kr As Long)
Dim OldCell as Range
Dim MonTexte As String
Dim sID As String, sLink As String, sPict As Object
'retenir la cellule avant changement
Set oldCell = ActiveCell
With Sheets("Essai")
MonTexte = .Cells(kr, 1).Resize(, 1).Value
' Vu la quantité de data, il faut une dimension supérieure
sLink = "https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=" & MonTexte
.Cells(kr, 2).Activate
Set sPict = .Pictures.Insert(sLink)
With sPict
'--- change la taille
.Width = 250
.Height = 250
'--- change la position
.Left = .Left + 5
.Top = .Top + 5
'--- pour info
Debug.Print .Name & " ajouté", , .Left, .Top
End With
oldCell.Activate
End With
'.Cells(kr, 1).RowHeight = 66
Set sPict = Nothing
End Sub