+ Reply to Thread
Results 1 to 4 of 4

Increment Macro - Order numbers

  1. #1
    Registered User
    Join Date
    01-24-2006
    Posts
    4

    Increment Macro - Order numbers

    Hello.

    I have set up a worksheet, using the increment macro, which enables me to send purchase orders via e-mail. Every time i go into the work sheet, i run the macro and the invoice number increases by one giving me a unique order number each time. I then save the file as that order number so i have a copy of the order that was sent.

    However, i was wondering whether there would be a way of the order number increasing by 1 automatically every time i opened the template (as opposed to every time i open the template i have to run the macro)?

    Any suggestions would be appreciated, thanks.

  2. #2
    NickHK
    Guest

    Re: Increment Macro - Order numbers

    Blues,
    Workbooks have a Workbook_Open event which fires every time the workbook is
    opened.
    Move you increment code to there.

    But if this is in a template, where do you store the "next number" ?

    NickHK

    "Blues" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hello.
    >
    > I have set up a worksheet, using the increment macro, which enables me
    > to send purchase orders via e-mail. Every time i go into the work
    > sheet, i run the macro and the invoice number increases by one giving
    > me a unique order number each time. I then save the file as that order
    > number so i have a copy of the order that was sent.
    >
    > However, i was wondering whether there would be a way of the order
    > number increasing by 1 automatically every time i opened the template
    > (as opposed to every time i open the template i have to run the
    > macro)?
    >
    > Any suggestions would be appreciated, thanks.
    >
    >
    > --
    > Blues
    > ------------------------------------------------------------------------
    > Blues's Profile:

    http://www.excelforum.com/member.php...o&userid=30771
    > View this thread: http://www.excelforum.com/showthread...hreadid=504383
    >




  3. #3
    Registered User
    Join Date
    01-24-2006
    Posts
    4
    Im pretty new to all of this so...

    What is the workbook open event? How do i access it???

    How do i store the 'next number'??? Where should i store it?

    I've just found this article, trying to plod along through it, is it applicable to my situation??? http://www.mcgimpsey.com/excel/udfs/sequentialnums.html

    Many thanks

  4. #4
    NickHK
    Guest

    Re: Increment Macro - Order numbers

    Blues,
    In the VBA IDE, double click on "ThisWorkbook", then from the drop down at
    the top that say "(General)", select "Workbook" and you will get the outline
    of the Workbook_Open sub.
    I'd say that was pretty much exactly what you are after.

    NickHK

    "Blues" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Im pretty new to all of this so...
    >
    > What is the workbook open event? How do i access it???
    >
    > How do i store the 'next number'??? Where should i store it?
    >
    > I've just found this article, trying to plod along through it, is it
    > applicable to my situation???
    > http://www.mcgimpsey.com/excel/udfs/sequentialnums.html
    >
    > Many thanks
    >
    >
    > --
    > Blues
    > ------------------------------------------------------------------------
    > Blues's Profile:

    http://www.excelforum.com/member.php...o&userid=30771
    > View this thread: http://www.excelforum.com/showthread...hreadid=504383
    >




+ 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