+ Reply to Thread
Results 1 to 6 of 6

Help with VBA to input data into a second sheet using formulas

  1. #1
    Registered User
    Join Date
    03-09-2017
    Location
    Bee Lick, KY
    MS-Off Ver
    2024
    Posts
    14

    Help with VBA to input data into a second sheet using formulas

    I really have no idea where to start trying to stitch something together for this.

    I have a Honey and Honeybee business, I am getting ready to start offering gift certificates and gift cards (gift cards are online and handled by Square). I have a sheet for the gift certificate serial numbers (barcodes) apart from the UPC-SKU sheet.
    On the Gift Certificate Register ("GC Register") sheet, I have formulas to calculate how much of the gift certificate was used and to tally a balance based on if Column A of the GC Register sheet is >0 OR (with a countif) GC Register A:A = Invoice A13:A43. Being they are IF statements, unfortunately they are dynamic so when I run my macro to print, save and create a new invoice, the values from the formulas are no longer present. And here lies my query.

    I need help with creating a macro to search or match is a gift certificate serial number has been entered on the invoice, find the cooresponding serial number and input the values of how much of the gift certificate was used and a balance.

    The formulas I am using are:

    Amount Used:
    =IF(OR(A2>0,(COUNTIF(Invoice!$A$13:$A$43,A2))),IF(G2>SUM(Invoice!$F$13:$F$43),SUM(Invoice!$F$13:$F$43),IF(SUM(Invoice!$F$13:$F$43)>G2,G2)))

    Balance:
    =IF(COUNTIF(Invoice!$A$13:$A$43,A:A),IF(SUM(Invoice!$F$13:$F$43)>=G2,0,SUM(G2-SUM(Invoice!$F$13:$F$43))))

    I used the OR function in the above formula only to always display a value and not "FALSE" in the cell.

    I've attached the very stripped down version of the workbook, any help will be greatly appreciated!

    Thanks,
    Greg
    Attached Files Attached Files
    Last edited by AD4GC; 02-22-2025 at 12:57 PM. Reason: Rephrase Title

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,929

    Re: Help with VBA with Formulas to input data into a second sheet

    If a Gift Certificate can be used against more than one invoice, then I suggest that you record the Invoice numbers in the "GC Register". In Invoice descrition I would record as "Gift Certificate " followed by name/customer number: "Gift Certificate - John Smith"

    I notice you keep a monthly (or it appears to be) invoice register: again I would keep an annual register. Equally, if the invoice amount is covered by a GC, then considedr recording this in the (Invoice) register.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    03-09-2017
    Location
    Bee Lick, KY
    MS-Off Ver
    2024
    Posts
    14

    Re: Help with VBA with Formulas to input data into a second sheet

    Quote Originally Posted by JohnTopley View Post
    If a Gift Certificate can be used against more than one invoice, then I suggest that you record the Invoice numbers in the "GC Register". In Invoice descrition I would record as "Gift Certificate " followed by name/customer number: "Gift Certificate - John Smith"

    I notice you keep a monthly (or it appears to be) invoice register: again I would keep an annual register. Equally, if the invoice amount is covered by a GC, then considedr recording this in the (Invoice) register.

    I don't suppose I follow the suggestion to include the invoice # in the GC Register, the only way a GC would or could be used more than once is if there was a positive balance remaining on the GC. I do already have formatting in order to record in the invoice description "Gift Certificate - John Smith".

    Yes, I do keep a monthly register, I had not thought of an annual register, but I like the idea, I will implement that immediately. I have a line for discounts (I think it is blank in the included workbook) in the totals section, I will format the "Discount" to read "Gift Certificate" when a GC has been entered.

  4. #4
    Registered User
    Join Date
    03-09-2017
    Location
    Bee Lick, KY
    MS-Off Ver
    2024
    Posts
    14

    Re: Help with VBA to input data into a second sheet using formulas

    Nobody? I would have thought somebody would know how to do this by now.

    Guess I'll start trying to hodgepodge something together.

    Any and ALL help is greatly appreciated.

  5. #5
    Registered User
    Join Date
    03-09-2017
    Location
    Bee Lick, KY
    MS-Off Ver
    2024
    Posts
    14

    Re: Help with VBA to input data into a second sheet using formulas


  6. #6
    Registered User
    Join Date
    03-09-2017
    Location
    Bee Lick, KY
    MS-Off Ver
    2024
    Posts
    14

    Re: Help with VBA to input data into a second sheet using formulas

    Solution from https://www.mrexcel.com/board/thread...3#post-6251460

    Please Login or Register  to view this content.

+ 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. Project to take an input of data and from user input, create sheet with relevant data
    By GibbysThirdChin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-13-2023, 05:31 PM
  2. Replies: 1
    Last Post: 06-09-2020, 03:31 PM
  3. [SOLVED] Input Data on one sheet and populate another sheet .. input data is not being captured
    By slbrick in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-16-2019, 02:35 AM
  4. [SOLVED] Input data to next row even if formulas exist
    By fremarco in forum Excel General
    Replies: 1
    Last Post: 08-09-2012, 10:04 AM
  5. Replies: 9
    Last Post: 04-04-2011, 12:03 AM
  6. [SOLVED] input conditional formulas using VBA Macro in axcel sheet
    By Francesco in forum Excel General
    Replies: 7
    Last Post: 04-02-2006, 08:55 AM

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