Closed Thread
Results 1 to 20 of 20

macro to produce purchase order data

  1. #1
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690

    macro to produce purchase order data

    hi guys

    i have a purchase order sheet

    firstly i have attached said spreadsheet
    1st sheet is named purchase order
    2nd sheet is named purchase order numbers

    upon opening the spreadsheet i would like on sheet purchase order to automatically input the next available number from column a in sheet purchase orders ( in this case next available is st010 and put that into cell k12 on sheet purchase order

    i then want to enter the relevant data in sheet purchase order cells
    b16 , b23 , g23 , i23 and d28

    i then want to click a button with macro attached to transfer that data in to sheet purchase order numbers

    how do i go about this please

    thank you
    Attached Files Attached Files

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    VBA Noob
    Last edited by VBA Noob; 10-17-2008 at 06:05 PM.
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    hi vba
    glad you replied you help me so much

    what sheet do i put that in?

  4. #4
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    dont suppose anyone can help with the first stage of the question please?

    upon opening worksheet i would like it to recognise the next available purchase order number

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    Please Login or Register  to view this content.
    Note this is just an example. I would suggest making some public variables which can be called from all the macros which will make it easier to read and amend.
    Also use more name ranges as you can avoid using the sheet name etc

    http://www.ozgrid.com/VBA/variable-scope-lifetime.htm
    http://support.microsoft.com/kb/843144

    VBA Noob

  6. #6
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    nothing happens at all vba

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Sorry.

    Code goes in ThisWorkbook


    Please Login or Register  to view this content.
    VBA Noob

  8. #8
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    the next number which would be st010 should go in to cell k12 of sheet purchase order
    upon opening of workbook
    but i get compile error invalid outside procedure
    and it highlights the word set

  9. #9
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Works for me.

    As I say set up all you're public variables and this may solve the problem

    VBA Noob

  10. #10
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    vba

    as you know im not very good with code so dont really understand what you mean by variables

  11. #11
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Two links attached below

  12. #12
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    over my head , not to worry , thanks anyway

  13. #13
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    vba
    is it possible you could attach what yours is like and then i can go from there because i have tried everything that i can but to no avail

    regards

  14. #14
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    As requested

    VBA Noob
    Attached Files Attached Files

  15. #15
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    thanks vba i get it now
    but i dont see what th difference was with yours and mine

    the last query of the thing is -

    when i open the sheet it now pulls up the next number available (which is perfect )

    i now want to create a button ( which is something i can do ) to input the date thats put on the purchase order ( you have the cells in yellow )(which is correct )
    into the purchase order number columns as they are obviously

    ie sheet purchase order cell b16 (supplier) into the same row as the purchase order number thats already been generated into sheet purchase order numbers into column b right next to the purchase order number lets say b16.
    then date from purchase order into c16
    and so on
    then i will create the save part which i can do , clear cells on sheet purchase order and close.

    then hopefully next time the sheet will then go down one more line to the next available purchase order number

    thanks so so much

  16. #16
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    I hope I don't confuse things by adding this, but I was working on a Purchase Order setup for a friend of mine (see attached). Admittedly, the format was mostly taken from a Microsoft Template, but I did all the userforms and code. Feel free to check it out and change anything as necessary. A couple of notes:

    1. I didn't create an event to launch the main entry userform (userform2). Feel free to implement a command button or something to do so.
    2. I have included a summary page which has a listing of all the POs. There is a column where you can select whether or not it has been paid. On the summary sheet, if you double click on an invoice, it will automatically take you to the PO.
    3. There is a hidden Vendors sheet in case you track vendors.

    Let me know if this helps you at all.
    Attached Files Attached Files

  17. #17
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    hi bas
    thanks for the help

    i have to keep our purchase orders basically set up as they are ( company very fussy on things like that )

    all i need to do is copy the relevant cells to the purchase number sheet

    then save it

    then next time i open it , it will give me the next number availablee

    but yours is very , very neat

  18. #18
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    cant see any macros in yours

  19. #19
    Forum Contributor
    Join Date
    06-23-2007
    Posts
    690
    i just cant seem to get to grips with getting the info i enter to tally up with the relevant line on the purchase order number sheet

  20. #20
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Thread closed for

    1) Originial question was answer
    2) Cross posting without link

    VBA Noob

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy Paste Macro
    By xiao85yu in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-26-2008, 02:42 PM
  2. Pause In Mid Macro To Modify Data
    By nebb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2007, 10:34 PM
  3. Macro to move data into a seperate worksheet in order
    By Vikkyann in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-09-2007, 04:13 AM
  4. Inventory data to purchase order
    By JEE in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-06-2006, 09:25 PM
  5. unable to copy the data from Excelsheet byVBA Macro
    By kamojjala_2000 in forum Excel General
    Replies: 2
    Last Post: 09-19-2006, 11:10 PM

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