Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Increment Macro - Order numbers

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Blues - 24 Jan 2006 09:40 GMT
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.

Signature

Blues

NickHK - 24 Jan 2006 09:52 GMT
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

> Hello.
>
[quoted text clipped - 10 lines]
>
> Any suggestions would be appreciated, thanks.
Blues - 24 Jan 2006 10:10 GMT
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 i
applicable to my situation??
http://www.mcgimpsey.com/excel/udfs/sequentialnums.html

Many thank
NickHK - 24 Jan 2006 10:23 GMT
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

> Im pretty new to all of this so...
>
[quoted text clipped - 7 lines]
>
> Many thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.