Resources In alphabetical Order

E

Esperanza

Hello, I had a question about getting a macro that I built in Project
to be able to alphabatize Resources. This is some of my code:

For Each R In Proj.Resources
xlR.Range("B1") = R.Name
For Each A In R.Assignments
'filter assignments that are not complete and scheduled to
start within the next two weeks
..........

Currently this macro opens an excel timesheet and puts the data in a
spreadsheet. The main point is that what i have now gives me these
resources sorted by ID, how do I get this to sort it by name in Excel?
Thanks.
 
J

John

Esperanza,
Depending on how your code is structured, why not simply do a sort on
the Excel column (i.e. "B") that contains the name, i.e.
xlR.Worksheets([whichever]).Range("B:B").Sort _
key1:=Worksheets([whichever]).Range("B:B")

If for some reason that is not practical, I would first load the
resource names into an array and then use a sort routine to re-arrange
the array before dumping into Excel.

Hope this helps.
John
 
R

Rod Gill

Hi,

Simplest is to do a Name sort in Project first. If you select the renumber
option the ids renumber so resource names are alphabetic.

You can do the name sort manually or in VBA.

--
For VBA posts, please use the public.project.developer group.
For any version of Project use public.project
For any version of Project Server use public. project.server

Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.projectlearning.com/
 

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