Hi Folks! I'm trying to write a macro so that I can generate QR codes using Google chart API then insert them into Excel as an image. What I would like is for the selected cell (which includes the Google chart API url and the concatenated information in one string) to be copied, then inserted using the Insert->picture, ->paste. So far, the macro works, but it does not use the new string when I select a new cell with another entry. It just keeps pasting the old "z_code" and I have to perform these steps manually to generate about 10 QR codes at a time.
Here is the code I used to generate the string. =CONCATENATE("https://chart.googleapis.com/chart?chs=125x125&cht=qr&chl=",Z_CODE,"") -> "Z_code" is a named ranged referring to the desired contents of the QR code. I would very much appreciate some assistance as this is a tremendously useful piece of code, if not just for myself. Thanks! I look forward to hearing from you.
Code:
Sub Macro2()
'
' Macro2 Macro
'
' Keyboard Shortcut: Ctrl+m
'
Selection.Copy
ActiveSheet.Pictures.Insert( _
"[URL]https://chart.googleapis.com/chart?chs=125x125&cht=qr&chl=124039-01Z20Z5060Z[/URL]" _
).Select
End Sub