+ Reply to Thread
Results 1 to 3 of 3

Purchase form with auto-sequential serial numbers

  1. #1
    Registered User
    Join Date
    01-31-2011
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003
    Posts
    26

    Purchase form with auto-sequential serial numbers

    Hello

    I have a excel based 'Purchase Order' form. Until now, my staff has been entering details on an open excel sheet which has too many problems such as over writing previously entered date, empty cells, etc

    I was hoping to get some help writing a macro to create a form (attached file) with the below conditions.

    1) The moment all fields in the attached forms are entered and the submit button is clicked, the data is moved to the purchase_listing and this form becomes blank and ready for the next entry.
    2) Its mandatory for the person to fill all fields otherwise the submit button should give an error.
    3) Lastly (perhaps the most difficult), P.O # should be an automated serial #. Hence when one form is submitted and the # is 213, the next form should automatically have # 214. However (here is the twist), if on a given date, even though 2 forms are filled at differing times but for the SAME SUPPLIER, the P.O # should be the same. The purchase_list has some draft examples.
    4) I am assuming the macro will have no conflict if i have filters for some of the fields so that its drop down to choose from.

    Thanks, your help is much appreciated.
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Purchase form with auto-sequential serial numbers

    Hello psanghvi,

    The attached workbook contains 2 macros. One is a worksheet change event macro. This macro updates the unprotects the worksheet, updates the PO number, and reprotects the sheet. The PO number is in the cell behind a rectangle shape that displays the PO number. This prevents the user from changing it. If you want to change the PO number, you must first unprotect the worksheet, select the cell F3, and press the left arrow key to select cell E3. After you change the PO number, the sheet protect will be applied again.

    The second macro is for the Submit button. This checks that the other workbook is open, all cells have been filled, write the data to the other workbook, and updates the PO number. If there is a problem then the user is notified by a dialog box. Here is the code for both macros.

    Worksheet_Change Event Code
    Please Login or Register  to view this content.

    Submit Button Macro Code
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    01-25-2012
    Location
    Pennsylvania
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Purchase form with auto-sequential serial numbers

    Leith Ross,

    Could you set this up so that instead of using 2 seperate workbooks both sheets were contained in 1 file? I am trying to create a PO system but would like the first sheet to be the "PO Log". This would be a protected sheet that tracks the data. The second sheet wold be the "PO Form". This would be where the data would be entered by the employees.

    Any help is appreciated.

    Thanks

    Mike

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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