+ Reply to Thread
Results 1 to 9 of 9

QR Code Function to Sub

  1. #1
    Registered User
    Join Date
    02-06-2013
    Location
    Mexico
    MS-Off Ver
    MS Office 2016
    Posts
    95

    Question QR Code Function to Sub

    Hello Experts, i found this function code to create a QR Code from specific Cell. But it works as "Formula" with this sintaxis: =@URL_QRCode_SERIES("qr_code_1",A3,,"qrCode")

    How can i convert it to a Sub routine that works with a button click and Input Box? I mean instead of Cell A3 Value, uses the Input Box Value when i click a button.

    Note: It uses Google API (https://ch

    Could any of you help me with it?

    Thanks!

    Please Login or Register  to view this content.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: QR Code Function to Sub

    DisplayText is used to return the result, which is display text in the cell containing the function so is not needed. Given that, I am not sure what this function does. A correctly designed function exists to return a value but this one has side effects that are the main purpose.

    Please Login or Register  to view this content.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    02-06-2013
    Location
    Mexico
    MS-Off Ver
    MS Office 2016
    Posts
    95

    Re: QR Code Function to Sub

    Jeff,

    thanks for explanation and support. But sub its not working, it cant be assigned to a shape / button to run.

    Could you support me with additional information and how to link it to a button?

    Thanks!

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: QR Code Function to Sub

    I see two problems.

    First my error. A Sub cannot declare a return type. Change the first line to remove the return type:

    Please Login or Register  to view this content.
    Also, a Sub that is called with a button may not have arguments. Your original function has arguments. When you use the original function in a cell you have to provide a picture name, and optionally picture size and Updateable. If you do not provide those as arguments, what do you want them to be when you push the button?

  5. #5
    Registered User
    Join Date
    02-06-2013
    Location
    Mexico
    MS-Off Ver
    MS Office 2016
    Posts
    95

    Re: QR Code Function to Sub

    Hello Again, i updated the code with your fix. But still cant assign it to a button. (The code was not generated by my, its one that i google it)

    In regards to your second question, for me its to create a shape with the QR code (Size 150 px) based on the InputBox information. I dont know if you refer to that arguments.

    I think, a picture shape needs to be created with the macro, then assign the information from the QR generated, isnt it? If yes, i dunno how to do it... could you help as well with that?

    Here is the code fixed with your suggestion:
    Please Login or Register  to view this content.

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: QR Code Function to Sub

    Quote Originally Posted by pacosalasv View Post
    In regards to your second question, for me its to create a shape with the QR code (Size 150 px) based on the InputBox information. I dont know if you refer to that arguments.
    The original function requires you to provide a PictureName to call it.

    Please Login or Register  to view this content.
    The code replaces an existing picture with another one at the specified URL. If you don't tell the Sub the PictureName, what picture do you want to replace when you click the button?

  7. #7
    Registered User
    Join Date
    02-06-2013
    Location
    Mexico
    MS-Off Ver
    MS Office 2016
    Posts
    95

    Re: QR Code Function to Sub

    I want to create a new one each time i click , i mean, when i click it generates QR Code it Generates a new image with an unique number.

    Its that possible?



    Thanks as well for your support in advance

  8. #8
    Registered User
    Join Date
    02-06-2013
    Location
    Mexico
    MS-Off Ver
    MS Office 2016
    Posts
    95

    Re: QR Code Function to Sub

    I found an other code and was able to modify with your suggestions, and works with the specic requierement.

    I appreciate your help and support!!

    here is the new code, if anyone needs it:

    Please Login or Register  to view this content.

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: QR Code Function to Sub

    I'm glad you found something that works. I am still having a hard time visualizing how your files works without having a copy.

    If your question has been answered please mark your thread as "Solved" so that members will know by looking at the thread title that your problem is solved. Go to the menu immediately above your first post to the thread and click on Thread Tools. From the dropdown menu select "Mark this thread as solved..."

    If a member helped you solve your problem, consider adding to their reputation by clicking on the star icon addreputationiconsmall.jpg below their name.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA code for custom function that returns detail results of array function
    By onechipshot in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2015, 06:30 PM
  2. VBA code to analyse data unless function code makes more sense than VBA,
    By vorabj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-03-2015, 12:38 PM
  3. [SOLVED] Code works in the macro but not in a separate function. "Sub or function not defined."
    By tahi.laci in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-28-2014, 12:38 PM
  4. Code to disable print function and "email as attachment" function
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-31-2013, 01:59 PM
  5. Add new code to old code to add extra function ??
    By james 35 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-08-2013, 08:16 AM
  6. [SOLVED] Code execution jumps from "end function" to the code beginning
    By Alexander_Golinsky in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-29-2012, 04:40 AM
  7. Code for a sum function
    By motmot in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-03-2010, 05:58 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1