+ Reply to Thread
Results 1 to 6 of 6

VBA code to auto update a field based on 2 fields

  1. #1
    Registered User
    Join Date
    02-01-2018
    Location
    INDIA
    MS-Off Ver
    2013
    Posts
    18

    VBA code to auto update a field based on 2 fields

    Dear all,

    I am creating a custom billing tool using excel & VBA.

    I am new to VBA advance codes like private sub and so..

    I have created a form. It has 2 variables.

    One is the amount and other is the gst %.

    Once i update / change the values in the amount or gst section, the total amount should be updated automatically.

    I have a code which updates the total amount based on changes in the gst section.

    If I change the amount section, the total amount is not updating accordingly.

    Attaching the file for reference.

    Seeking your help to get a code which updates the total based on any change in either amount or gst.


    Thanks in advance..!!


    **** EDIT ****

    In my attached file, if we click the Button 1, one user form will open.

    In that, if we input the values in the box corresponding to AMT and GST%, the total will be calculated and displayed in the corresponding box.

    Now, if we are changing the AMT content means, the total value is not calculating.
    In this case, i am reentering the GST% value to auto calculate the total.

    Meanwhile, whenever i am changing the GST% content, the total value changes automatically.

    My need is, the total value needs to be auto calculated and displayed whenever i am making changes to either AMT or GST%.
    Attached Files Attached Files
    Last edited by prabhu04; 08-30-2020 at 11:06 PM. Reason: More details

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: VBA code to auto update a field based on 2 fields

    .
    Here is a sample database Userform. Study the code and apply to your project.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-01-2018
    Location
    INDIA
    MS-Off Ver
    2013
    Posts
    18

    Re: VBA code to auto update a field based on 2 fields

    Hai Logit,

    thank you for the quick update.

    But i hope the code you sent is different from my need or somewhere I am lagging to understand yours..!!


    In my attached file, if we click the Button 1, one user form will open.

    In that, if we input the values in the box corresponding to AMT and GST%, the total will be calculated and displayed in the corresponding box.

    Now, if i am changing the AMT content means, the total value is not calculating.
    Meanwhile, whenever i am changing the GST% content, the total value changes automatically.

    My need is, the total value needs to be auto calculated and displayed whenever i am making changes to either AMT or GST%.

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: VBA code to auto update a field based on 2 fields

    .
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-01-2018
    Location
    INDIA
    MS-Off Ver
    2013
    Posts
    18

    Re: VBA code to auto update a field based on 2 fields

    Thank you Logit.....

    This works....

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: VBA code to auto update a field based on 2 fields

    .
    You are welcome.

+ 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. [SOLVED] Need help with creating a formula to auto pop 3 fields based on selection in one field.
    By chiefgb in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-02-2014, 05:25 PM
  2. [SOLVED] Create Auto Populated list Field based off multiple fields
    By alendor in forum Excel General
    Replies: 4
    Last Post: 04-22-2014, 11:38 AM
  3. Auto fill macro for fields below the active field
    By Macgyver7 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-11-2014, 06:26 PM
  4. how do you update fields based on wording in another field w/o a formula in cell
    By juniperjacobs in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2010, 09:17 AM
  5. how do you update fields based on instructions in another field w/o a formula in cell
    By juniperjacobs in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-16-2010, 01:50 PM
  6. How to auto update a field when the database field changes
    By hari_sudhan in forum Excel General
    Replies: 0
    Last Post: 03-20-2009, 07:15 AM
  7. Auto Update of a field referencing to a field in another workbook
    By Camper Joe in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-14-2006, 02:20 PM

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