I
Ian H - Project Swat
I have borrowed some code off the net (it was free by the way but can't find
the chap's name at present) that imports project data in to an excel template
I created that has conditional formatting and variable name ranges in it,
etc. However, I want to filter data out before it comes in to Excel but
without using MS Project views, filters or maps.
Why without - because some of the people who will use this template don't
even know what a view is, never mind the fact they may change it and corrupt
the table that uses it. Whilst very sharp guys in other respects, I want to
make this macro and template as idiot proof as possible.
The part of the code for brining the fields in is below but I want to filter
out any Number1 values greater that 3 or blank.
varRowCount = 1
For Each varTask In varProj.Tasks
varTaskInformations.Offset(varRowCount, 0) = varTask.Text1
varTaskInformations.Offset(varRowCount, 1) = varTask.Text25
varTaskInformations.Offset(varRowCount, 2) = varTask.Number1
varTaskInformations.Offset(varRowCount, 3) = varTask.Name
varTaskInformations.Offset(varRowCount, 4) = varTask.PercentComplete
varTaskInformations.Offset(varRowCount, 5) = varTask.BaselineFinish
varTaskInformations.Offset(varRowCount, 6) = varTask.Finish
varTaskInformations.Offset(varRowCount, 7) = varTask.Date10
varTaskInformations.Offset(varRowCount, 8) = varTask.Text21
varTaskInformations.Offset(varRowCount, 9) = varTask.Text22
varTaskInformations.Offset(varRowCount, 10) = varTask.Text26
varTaskInformations.Offset(varRowCount, 11) = varTask.Text19
varTaskInformations.Offset(varRowCount, 12) = varTask.Flag20
varTaskInformations.Offset(varRowCount, 13) = varTask.Text23
varTaskInformations.Offset(varRowCount, 14) = varTask.Flag18
varTaskInformations.Offset(varRowCount, 15) = varTask.Flag19
varTaskInformations.Offset(varRowCount, 16) = varTask.Text10
Me.lblProgress.Width = 222 * (varRowCount / varProj.Tasks.Count)
Me.fmeProgress.Caption = Format(varRowCount / varProj.Tasks.Count, "0%")
DoEvents
varRowCount = varRowCount + 1
Next
Any help greatly appreciated as this is driving me nuts and now rather ugent.
Many thanks
Ian H
the chap's name at present) that imports project data in to an excel template
I created that has conditional formatting and variable name ranges in it,
etc. However, I want to filter data out before it comes in to Excel but
without using MS Project views, filters or maps.
Why without - because some of the people who will use this template don't
even know what a view is, never mind the fact they may change it and corrupt
the table that uses it. Whilst very sharp guys in other respects, I want to
make this macro and template as idiot proof as possible.
The part of the code for brining the fields in is below but I want to filter
out any Number1 values greater that 3 or blank.
varRowCount = 1
For Each varTask In varProj.Tasks
varTaskInformations.Offset(varRowCount, 0) = varTask.Text1
varTaskInformations.Offset(varRowCount, 1) = varTask.Text25
varTaskInformations.Offset(varRowCount, 2) = varTask.Number1
varTaskInformations.Offset(varRowCount, 3) = varTask.Name
varTaskInformations.Offset(varRowCount, 4) = varTask.PercentComplete
varTaskInformations.Offset(varRowCount, 5) = varTask.BaselineFinish
varTaskInformations.Offset(varRowCount, 6) = varTask.Finish
varTaskInformations.Offset(varRowCount, 7) = varTask.Date10
varTaskInformations.Offset(varRowCount, 8) = varTask.Text21
varTaskInformations.Offset(varRowCount, 9) = varTask.Text22
varTaskInformations.Offset(varRowCount, 10) = varTask.Text26
varTaskInformations.Offset(varRowCount, 11) = varTask.Text19
varTaskInformations.Offset(varRowCount, 12) = varTask.Flag20
varTaskInformations.Offset(varRowCount, 13) = varTask.Text23
varTaskInformations.Offset(varRowCount, 14) = varTask.Flag18
varTaskInformations.Offset(varRowCount, 15) = varTask.Flag19
varTaskInformations.Offset(varRowCount, 16) = varTask.Text10
Me.lblProgress.Width = 222 * (varRowCount / varProj.Tasks.Count)
Me.fmeProgress.Caption = Format(varRowCount / varProj.Tasks.Count, "0%")
DoEvents
varRowCount = varRowCount + 1
Next
Any help greatly appreciated as this is driving me nuts and now rather ugent.
Many thanks
Ian H