Auto numbering of customer field

T

Thomas Malmberg

Need to auto number project no (customer field) from within a range plus 1.
Just to get a unique no for every project created. How can?
 
R

Rod Gill

Please always state version of Project (SP level helps as well).

Assuming no Project Server, the only way is to use VBA to either save the
latest number in a text file, or a database. Then use code to update same
with latest value. While you're at it, make sure you save the project title
as well.

--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

Author of the only book on Project VBA, see: http://www.projectvbabook.com




Thomas Malmberg said:
Need to auto number project no (customer field) from within a range plus
1.
Just to get a unique no for every project created. How can?

--
Thomas Malmberg
Provanum AB, SWE

__________ Information from ESET Smart Security, version of virus
signature database 4872 (20100216) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 4872 (20100216) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
P

Piet Remen

If you do have project server however, you could possibly achieve this by
creating a custom event handler on a project even such as Publishing, Saved
etc... You would need to read a list of existing project IDs and, sort them
and determine the next available ID and store that value in the cutom field.
The problem here is a Project Manager can still change the value via the
project schedule so not a great idea in my mind. Project server is doing this
for you already behind the scenes as each project created is uniquely
identified by its Project GUID. If possible, use this value instead.

Regards,

Piet Remen
www.projectserver.com.au
 
D

Dean C

Insert all of your projects into another project to create unique ids for
each project. The IDs will be unique only to the project that you inserted
them into, so you will need to keep the consolidated schedule for the next
project you have. To get the Master project's unique ID into the number1
field for each task in each subproject, run the macro below. The macro
assumes that you keep all projects in the same folder. After you verify that
your mod to the macro works the way you want, you probably want to close each
subproject after you set the value. I didn't understand what you meant by
range plus 1, so you'll have to figure that out.

Sub ProjectNumber()
Dim MyProjectNumber
For Each myproject In ActiveProject.Subprojects
SourceSchedule = ActiveProject.Path & "\" &
myproject.SourceProject.Project & ".mpp"
MyProjectNumber = myproject.InsertedProjectSummary.UniqueID
Application.FileOpen Name:=SourceSchedule,
ignoreReadOnlyRecommended:=True 'The file needs to be opened to make the
macro run faster, but you could step through each task in each project, it
will probably take a long time if you do
SelectSheet
OutlineShowAllTasks
SetTaskField Field:="Number1", Value:=MyProjectNumber, Allselectedtasks:=True
Next myproject
End Sub
 
L

Lars Hammarberg

Perhaps this is not applicable to your system, but I would think the main
reason for doing this is to be able to connect your projects with another
system/application?

Why not use that other system's identifier in a project level custom field?

Otherwise, if you want a numbering system in order to create a list of
projects in the order they were created, simply order the list on "create
date".
 

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