What does this Macro do?

B

BillV

I found this Macro with my Project Schedule and I have no idea what it does.
I am not well enough versed in VBA to know. Can anyone tell me what this
does?
 
J

JulieS

Hi BillV,

Please post the code :). Go to the Visual Basic Editor, find the macro
code and copy/paste.

Julie
 
B

BillV

Oops, I'm under a lot of pressure and forgot to past the Macro. Here it is:

Sub Format_Duration()
Application.OpenUndoTransaction ("Format Duration")
On Error GoTo ErrorHandler

Check_if_Project_Open

frmFormatDuration.InitializeList
frmFormatDuration.cboDurUnit.SetFocus
frmFormatDuration.cboDurUnit.SelStart = 0
frmFormatDuration.cboDurUnit.SelLength =
frmFormatDuration.cboDurUnit.TextLength
frmFormatDuration.Show
ExitSub:
Application.CloseUndoTransaction
Exit Sub

ErrorHandler:
ProcessError Err
GoTo ExitSub
End Sub

Private Sub Check_if_Project_Open()
'Procedure checks if a project file is open

On Error GoTo NoFileOpen:

Dim strName As String

strName = ActiveProject.Name

Exit Sub

NoFileOpen:
MsgBox MSG_NO_PROJECT_OPEN, vbExclamation + R_TO_L,
Title:=Application.Name
End 'End the macro

End Sub
 
J

Jack Dahlgren

It formats the duration.
This is one of the built-in macros that come with project.
It shows the format duration form which (if I remember correctly) lets you
change the duration format on tasks from hours to days to weeks or whatever.
The format can be different on different tasks depending on what you have
entered - for example I may have entered 32h on one task and 5d on another.
If I want them all in hours or all in days I'd run that macro and it can
convert the 5d to 40h or it could convert the 32h to 4d or the 5d to 1w.
Nothing more to it than that. Not very useful in my opinion.

-Jack
 
B

BillV

Thanks, Nice.

Jack Dahlgren said:
It formats the duration.
This is one of the built-in macros that come with project.
It shows the format duration form which (if I remember correctly) lets you
change the duration format on tasks from hours to days to weeks or whatever.
The format can be different on different tasks depending on what you have
entered - for example I may have entered 32h on one task and 5d on another.
If I want them all in hours or all in days I'd run that macro and it can
convert the 5d to 40h or it could convert the 32h to 4d or the 5d to 1w.
Nothing more to it than that. Not very useful in my opinion.

-Jack
 

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