+ Reply to Thread
Results 1 to 5 of 5

Two Commandbuttons with one textbox values change in one userform

  1. #1
    Registered User
    Join Date
    03-27-2019
    Location
    Komarapalayam
    MS-Off Ver
    2016
    Posts
    26

    Two Commandbuttons with one textbox values change in one userform

    Hi,

    I have workbook with commandbuttons & a userform.

    Worksheet Names are Form, Quotation. In Form Sheet having three Commandbuttons. There are New, Edit, Generate Buttons.

    In Userform as below,

    Textboxes are txtano, txtdate, txttime, txtdel

    checkbox with textbox enabled options:
    If chkmlk checked, then enable txtmlk,
    If chkcrd checked, then enable txtcrd,
    If chkbtmlk checked, then enable txtbtmlk,
    If chkbtr checked, then enable txtbtr,
    If chkghe checked, then enable txtghe,
    If chkmlkgv checked, then enable txtmlkgv,
    If chkcrm checked, then enable txtcrm,
    If chkpnr checked, then enable txtpnr,
    If chkmsrm checked, then enable txtmsrm,
    If chkrmbg checked, then enable txtrmbg,

    If I click New button then open Userform with autogenerate of Last A.No in textbox txtano from Form sheet in Column A. After completing the userform, Click Add button then store the values in last row of Form sheet. Here disable Update button in Userform. Form Sheet entries given through Userform only means sheet protected.

    If I click Edit button then fetching activerow values into Userforms textboxes and also tick the checkboxes. After editing process in Userform, by click Update button then amendment in respective row of A.No in Form sheet. Here disable Add button in Userform.

    If I click Generate button then copy & paste active row values into Next sheet of Quotation in specified cells.

    A.No Value in B4 of Quotation sheet. Delivery Name value in B3 of Quotation sheet.

    Headers of Form sheet into offset in B Column of Quotation Sheet.

    If Header's Qnty value present in Form sheet, then offset values in quotation sheet column B, C. Else ignore headers & qnty in B & C of Quotation Sheet.

    I would be happy expert can sort my issues in the workbook.

    Here I enclosed my workbook, Order Form.xlsm

    Thanks in advance.
    Thanks
    V.Nandhakumar

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,410

    Re: Two Commandbuttons with one textbox values change in one userform

    first question, will you be quoting for more than ten items ???
    if so you should prepare yourself a 'database' type list of all your goods that you want to quote for.
    if your quotation form is restricted to listing ten items at a time use comboboxes to select from your 'database'
    for data storage use a 'structured table' format with each entry on a separate row - makes for far easier data storage/retrieval.
    I have attached to your file the 'structured table' format just to illustrate.
    I have not touched your coding as there is no point me proceeding further if this approach is not acceptable to you.
    Attached Files Attached Files
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Registered User
    Join Date
    03-27-2019
    Location
    Komarapalayam
    MS-Off Ver
    2016
    Posts
    26

    Re: Two Commandbuttons with one textbox values change in one userform

    Hi Torachan,

    Thanks for your valuable reminder.

    I have fixed 10 items only.

    Now I tried myself, what I did,

    Using two userforms - one is for new button, second is edit button. this is ok now.

    I have an issue in Generate button click.

    That also code created with activecell.row, cell number. My issue is how to check value present in activecell row value = "-", then ignore header and go to next value and header.

    For example

    In Header Cell & Activecell range is,

    Item#1 Item#2 Item#3 Item#4 Item#5 Item#6 Item#7 Item#8 Item#9 Item#10 ---> Header is E3:N3
    9 - 9 9 9 9 - 9 9 - ---> Activecell is A12

    check active cell value is "-" then ignore header & qntys.

    What I Expect in Quotation Sheet is,
    In Column
    B6 C6 D6
    Item#1 9 Ltrs
    Item#3 9 Ltrs
    Item#4 9 Ltrs
    Item#5 9 Kgs
    Item#6 9 Kgs
    Item#8 9 Kgs
    Item#9 9 Kgs


    Hope I explain clearly.

    I expecting to sort out this.

  4. #4
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,410

    Re: Two Commandbuttons with one textbox values change in one userform

    an updated workbook accompanying your post would be more helpful.

  5. #5
    Registered User
    Join Date
    03-27-2019
    Location
    Komarapalayam
    MS-Off Ver
    2016
    Posts
    26

    Re: Two Commandbuttons with one textbox values change in one userform

    Hi,

    Here enclosed workbook.

    Order Form 2.xlsm

    Thanks

+ 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] VBA Userform - Lookup/Match Textbox values to prefill other Textbox values
    By Lee_of_Excel in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-26-2020, 06:27 PM
  2. VBA Userform change textbox value based on Forecolor of a different textbox
    By joao1232 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-06-2016, 03:30 PM
  3. Change location of commandbuttons on multi page in userform using vba
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-19-2013, 10:13 AM
  4. Userform to search textbox value to place other textbox values in worksheet
    By mattyh555 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-19-2012, 11:38 AM
  5. Replies: 3
    Last Post: 05-07-2012, 09:46 PM
  6. Change color of commandbuttons based in cell values
    By mmf in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-20-2008, 08:50 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