Generating QR codes using a Macro

mcorbeil

New Member
Joined
Jun 13, 2013
Messages
3
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.
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
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.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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.

I think this post may help you a little:

http://en.libreofficeforum.org/node/1466
 
Upvote 0
Thank you for the reply Ericward. Not exactly what I was looking for as it's for LibreOffice Calc. I need to change the end of the Google API Qr url to be a dynamic in the above code, instead of just repeating the same Google api url with the same characters after the "qr&chl=??????" in the macro. Basically I'm generating QR labels for different job codes on a worksheet. I want a macro to do the copy/insert picture/paste QR url for each entry down the page, I can arrange them manually after the fact. Bumpity Bump.....
 
Upvote 0
Did you manage to get the code i would also want to have it, the project i am working on really depends on this.
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,885
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top