Ask Experts Questions for FREE Help !
Ask
    BertG's Avatar
    BertG Posts: 2, Reputation: 1
    New Member
     
    #1

    Mar 25, 2011, 07:26 AM
    Auto Sequential Numbering
    Is there a way within Excel to Auto Generate a new number every time I open a spreadsheet.ie: I made a Purcahse Order template and I would like for Excel to generate a new Purchase Order number whenever I open it up. Can anyone let me know if this is a possibility.
    BrookW97's Avatar
    BrookW97 Posts: 4, Reputation: 1
    New Member
     
    #2

    Mar 26, 2011, 04:16 AM
    I don't know how to do every time it opens, but you can do this by recording a Macro. If you aren't familiar with Macros, it's a way to record an action or series of actions. Basically, once you've recorded the Macro and told it what to do... you will just have a button in excel to click on every time you want a new invoice number.
    I think for what you want, you will have to do in visual basics. I'm not very good at those but office has some step by step instructions. Search "Create a macro by using Microsoft Visual Basic" in HELP. (you will probably have to add the developer tool bar but this is all in step by step)
    when it mentions code---
    Try to use a code similar to this and paste just before sub: Range("D3").Value = Range("D3").Value + 1
    I know you can also insert an object (button) and assign the macro to that button.

    This is all above my head though--but maybe it will get you pointed in right direction.
    good luck!
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #3

    Mar 26, 2011, 05:02 AM

    This is better done in a database, but is possible in a spreadsheet. But to help you we need to know more about the structure of your template. If it is, in fact a template (xlt file) then you would need to read the number from the last PO you saved since you can't save the template. So more info is necessary.
    BertG's Avatar
    BertG Posts: 2, Reputation: 1
    New Member
     
    #4

    Mar 28, 2011, 05:01 AM
    Thanks for your response. I did find a way to do it in VBE. With the following code:
    Sub auto_open()
    On Error Go to ErrorCatch
    Cells(9, 13) = Cells(9, 13) + 1
    If Cells(9, 13) = 10000 Then Cells(9, 13) = 0
    ErrorCatch:
    End Sub

    It works great. I get a new p.o. # every time I open the Purchase order file.

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Sequential numbering in Excel [ 3 Answers ]

Hi, I'm trying to number a column in sequential order by counting the number of times a certain word is typed in another range. For example: AAA 1 BBB 1 AAA 2 AAA 3 CCC 1 I need the numbers to be in sequence in column B:B every time a word is typed multiple times in column A:A.

Sequential alpha auto fill [ 0 Answers ]

Continuing with the auto fill alpha characters in Excel or Access - I have a repeating number in a column, need to assign an alpha character sequentially after each row where the numeric value is repeated after the first time it appears. I.E. column A row 1 = 123, row 2 = 123a, row 3 = 123b etc?

Macros for sequential numbering in multiple worksheets in excel with [ 1 Answers ]

I have a workbook with worksheets for each day of the month. I need to subtract one day to = equal number of days left in the month. Ex(May 1st there are 31 days left in month, May 2nd, worksheet two, there are 30 days left in the month, and so on and so forth.) Is there a way to have these days...

Columns, Auto Numbering Microsoft Office [ 2 Answers ]

Where can I find or how can I set up a two column list with auto numbering using Microsoft Office? I´m new to this version.


View more questions Search