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
 
I tried both options and yes they work, and yes the codes are ok.

Thank you very much :)

The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
Upvote 0

Excel Facts

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

Forum statistics

Threads
1,223,894
Messages
6,175,250
Members
452,623
Latest member
Techenthusiast

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