PDA

View Full Version : Autonumber form but be able to save as file each time



azleidbug
02-03-2010, 01:36 PM
I have a po form that I set up. I have to autonumber a cell each time it is opened. I need to be able to "save as" each po but continuing to autonumber. I know there is a way to write to another worksheet the date/time and po number each time the form is accessed. I just can't figure out how to do this. This is the Macro that I am using:

Private Sub Workbook_Open()
MsgBox "You are now entering a new PO That's right..."
Worksheets("Sheet1").Range("B1").Value = Date
Worksheets("Sheet1").Range("D1").Value = _
Worksheets("Sheet1").Range("D1").Value + 1
End Sub
any help would be greatly appreciated. Thanks so much


. ~Oorang:)

Oorang
02-04-2010, 08:41 PM
What is "po"?

GTO
02-05-2010, 01:28 AM
Hi Aaron :-)

I believe that's Purchase Order (number)

Mark

azleidbug
02-05-2010, 11:53 AM
Hi, sorry, it is a purchase order. It's just a form we use but my supers are hand writing everything and i came up with a form but i can't get it to autonumber each time it is opened but save it as the new po number.

lucas
02-05-2010, 01:08 PM
So you are using a sheet for data input and then want to save a copy of the sheet with an incremental number each time?

GTO
02-05-2010, 01:56 PM
Greetings AZLeidbug,:mayi:

I just caught on (partially at least) to your username, as well as your recent joining. Sorry I missed that last night, a bit thick-headed on this end and was overly tired.

Have to get my rear in gear and get to work, but please let me say Welcome! to vbaexpress - imho, the bestest forum! I am quite sure that you'll be glad you joined; there are some great folks here:) , even the Okies:rofl: .


...but i can't get it to autonumber each time it is opened but save it as the new po number.

So you are using a sheet for data input and then want to save a copy of the sheet with an incremental number each time?

In reference to your question and in addition to Steve's, what would the pattern look like for creating new PO numbers?

You might find it easiest/clearest to attach a small example wb with an example of several PO numbers in series, a short explanation ("Our PO NUmbers start with YY followed by a hyphen and six digits...") of the PO number creation and what the resultant filenames should be.

Hope to help, and again, welcome aboard,

Mark

GTO
02-05-2010, 01:58 PM
ACK! Forgot to ask, what's the leidbug part?

Gotta go for now, else I'll be showing up ducking the boss...