Print the projects in alphabetic order

M

Majid

Hello Dear:
I have many projects lined up one row after earch other. For printing
purpose team member would like to see the projects in alphabetic order.
Perhaps I need a VBA code for the column that has project name? I tried to
sort the column but there is no alphabetic sorting option.
Please advise
 
J

Jan De Messemaeker

Hi Majid,

You can sort on any column, even on fields that are not visible
Project, Sort, Sort by...

HTH
 
M

Majid

Thank you Jan for your quick respond, it is working. Is there any way the
master file is sorted upon saving the file or each time I have to sort it
manually?
 
J

Jan De Messemaeker

Hi,

I had never tried this before (have you?) but when I try it, when opening
the taks are in sorted order.
HTH
 
M

Majid

I tried both ways one is I saved it to see if it is sorting automatically as
it is defined. I also tried to close the file and re-open and it was not
sorting as well. The only way the sorting works is after editing completed
we manually sort it. Obviosely the level of the sorting is saved but it is
not active until until we ask for it.
Is there any way when I save the file it sorts as well? or at least have
icon on the menu bar so that team memeber can click on it in one step.
Please advice Thank you
 
J

Jan De Messemaeker

Hi Majid,
The icon thing is easy.
Have a macro that sorts (use the application.sort method)
Create an extra icon on the toolbar
(Insert an existing icon, you can change appearance when right-clicking it
with the customize toolbar window open)
Link it to the sorting macro
HTH
 
M

Majid

Thank you Jan for the feedback. I am not sure if I can write the VBA code.
I would like to always sort by "text 1" then "name" and then by "text 7"
I hope you can help me out on this
Regards,
Majid
 
J

Jan De Messemaeker

Hi Majid,

Copy/Paste this:

Sub Sortit()
viewapply "Gantt Chart"
Filterapply "All Tasks"
Outlineshowalltaks
sort key1:="Text1",ascending1:=true, _
key2:="Name",ascending2:=true, _
key3:="Text7",ascending3:=true, outline:=false
end sub


Hope this helps,
 
M

Majid

Hi, Thanks for the code. I tried copying the code and running the macro but
it has some problem. While compliling and running the code it is showing
Runtime error 1100 saying "Method is not available in this situation". Do we
require any expression before method Outlineshowalltasks. Removing this
method makes it work, but then each time we add or copy anything we have to
run macro manually. I presume this will make it automatic. Pleas advice.

Thanks
Majid
 
J

Jan De Messemaeker

You're right. The applies to object is required, so:

MSproject.application.outlineshowalltasks

This does not make it run automatically, I think you just asked how to do it
from a button.
Is it asked to much to click a button every now and then?

HTH
 

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