Incrementing Numbers

E

Elizabeth Valorz

I am creating a Purchase Order template in Excel. I would
like the Purchase Order number to be updated everytime I
open it. I have seen posts in here for that function but
I have no experience in typing in code or how to use it
after typing the code. What I need is an answer for
dummys :) If someone could give me step by step
instructions I would really appreciate it. Thank you.

Liz Valorz
 
O

Otto Moehrbach

Elizabeth
I recommend that you increment the number (automatically) when you print
the Purchase Order rather than when you open the file. That would preclude
the often occurring incidence of not completing the PO for one reason or
another and having to manually de-increment the number the next time you
open the template.
But here is how you do what you say. At the top of your screen (when
you have Excel open), you have a menu that runs from left to right. The
left-most item is File. Look to the left of that word, File, and you will
see an Excel logo. Right-click on that logo. Paste the following macro
into the module that is displayed.

Private Sub Workbook_Open()
With Sheets("TheSheet")
[A1] = [A1] + 1
End With
End Sub

I wrote it to increment the number in Cell A1 in a sheet named "TheSheet".
You can change that to anything you like. After you have pasted this macro,
click the "X" in the top right corner to exit and return to your Excel
sheet. Please post back if you need anything more.
HTH Otto
 
E

Elizabeth Valorz

Hello, it worked beautiful, did just what I wanted it to.
Thank you so much. This is such a helpful and informative
forum I have learned alot by just reading the posts. And
I think all you people who take the time to help everyone
are just great. Thanks again.

Liz
-----Original Message-----
Elizabeth
I recommend that you increment the number (automatically) when you print
the Purchase Order rather than when you open the file. That would preclude
the often occurring incidence of not completing the PO for one reason or
another and having to manually de-increment the number the next time you
open the template.
But here is how you do what you say. At the top of your screen (when
you have Excel open), you have a menu that runs from left to right. The
left-most item is File. Look to the left of that word, File, and you will
see an Excel logo. Right-click on that logo. Paste the following macro
into the module that is displayed.

Private Sub Workbook_Open()
With Sheets("TheSheet")
[A1] = [A1] + 1
End With
End Sub

I wrote it to increment the number in Cell A1 in a sheet named "TheSheet".
You can change that to anything you like. After you have pasted this macro,
click the "X" in the top right corner to exit and return to your Excel
sheet. Please post back if you need anything more.
HTH Otto


Elizabeth Valorz said:
I am creating a Purchase Order template in Excel. I would
like the Purchase Order number to be updated everytime I
open it. I have seen posts in here for that function but
I have no experience in typing in code or how to use it
after typing the code. What I need is an answer for
dummys :) If someone could give me step by step
instructions I would really appreciate it. Thank you.

Liz Valorz


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top