VBA formula not working, trying to insert an image

Joe84

New Member
Joined
Apr 9, 2022
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hello :-)

So I recently added some QR codes to an excel sheet I was using to generate labels.
And now I wanted to generate these labels automatically, however im stuck on this section of code.

1688118201429.png


I have been trying for a few days to make it work.
My Excel is in spanish, but I have translated the formula to english.

The code in B2 is working fine if it is introduced manually, but VBA doesn't seem to recognise it.

VBA Code:
Worksheets(SheetName).Cells(2, 2).Formula = "=IMAGE('https://api.qrserver.com/v1/create-qr-code/?size=150x150&data='&TEXTJOIN(,,A2,A1))"

Any help would be much appreciated.

Regards
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
1688119323729.png


Rich (BB code):
"=IMAGE(""https://api.qrserver.com/v1/create-qr-code/?size=150x150&data="" &""TEXTJOIN(,,A2,A1) "")"

how about this?
 
Upvote 1
Thank you so much, this worked perfectly

i think you should double check again regarding the images, make sure the images all are being inputted correctly (desire barcode address with correct output barcode).

my site here sometime the output of barcode didn't update on time
 
Upvote 0
i think you should double check again regarding the images, make sure the images all are being inputted correctly (desire barcode address with correct output barcode).

my site here sometime the output of barcode didn't update on time

Yes actually you are right, I saw a QR code and thought, ¡this worked! and immediatly moved on to the next issue 🤦
The QR code literally reads "Textjoin(,,A1,A2)" and not "CB1200"
 
Upvote 0
1688125304732.png



Cells(4, "b").Formula = "=IMAGE(""https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=""&TEXTJOIN(,,A2,A1))"
Cells(2, "b").Formula = "=IMAGE(""https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=""&A2&A1)"

Cells(4, "e").Formula = "=IMAGE(""https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=""&TEXTJOIN(,,D2,D1))"
Cells(2, "e").Formula = "=IMAGE(""https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=""&D2&D1)"

2options, should be okay? But again, make sure the images all are being inputted correctly (desire barcode address with correct output barcode) and Capital letters as well
 
Upvote 1
Solution
View attachment 94520


Cells(4, "b").Formula = "=IMAGE(""https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=""&TEXTJOIN(,,A2,A1))"
Cells(2, "b").Formula = "=IMAGE(""https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=""&A2&A1)"

Cells(4, "e").Formula = "=IMAGE(""https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=""&TEXTJOIN(,,D2,D1))"
Cells(2, "e").Formula = "=IMAGE(""https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=""&D2&D1)"

2options, should be okay? But again, make sure the images all are being inputted correctly (desire barcode address with correct output barcode) and Capital letters as well

I tried both options and yes they work, and yes the codes are ok.

Thank you very much :)
 
Upvote 0
I tried both options and yes they work, and yes the codes are ok.

Thank you very much :)
Glad to assist, If you have any further questions, please don't hesitate to ask/share with us :)
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,244
Members
452,622
Latest member
Laura_PinksBTHFT

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