Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Apr 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Auto increment values (2000/XP)

    I am setting up a purchase order form template that will stamp some key data to another sheet for a log. I want the PO number to auto increment to the next number when the template opens. Is there a way to do this? Do I have to have another file that contains the PO number value and read that, bump up by one and write it back out or what? Help please...

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Auto increment values (2000/XP)

    Does <post#=171133>post 171133</post#> give you enough to go on?

    Steve

  3. #3
    New Lounger
    Join Date
    Apr 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto increment values (2000/XP)

    Thanks Steve, I'm learning. [img]/forums/images/smilies/wink.gif[/img] Got the macro built and tests OK.
    How do I get this macro to automatically run once when then workbook is opened?

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Auto increment values (2000/XP)

    Add something like this to the thisworkbook object in the appropriate file (not a normal module), where MyRoutine is the name of the routine you want to run. It will run whenever the workbook (with this code) is open.

    Steve
    <pre>Private Sub Workbook_Open()
    MyRoutine
    End Sub
    </pre>


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •