#1
|
|||
|
|||
Looping backwards through a 'For Each' collection
Here is the usual VBA code for looping through all tasks in Projects:
For Each t In ActiveProject.Tasks {code for desired action} Next t This loops through from the top down (as far as I can tell). Anyone have any ideas as to how I can reverse this and go from the bottom up? Thanks JB |
#2
|
|||
|
|||
Solved (with all credit to Tom Boyle)
Sub BackTasks() Dim t As Task Dim i As Long For i = ActiveProject.Tasks.Count To 1 Step -1 Set t = ActiveProject.Tasks(i) If Not t Is Nothing Then 'Your Code Here End If Next i End Sub |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
site collection is inaccurate | dbsoccer51 | Misc | 0 | 12-02-2015 03:30 PM |
Upgrading backwards !!! | Soporose | Office | 1 | 09-23-2014 02:04 AM |
how to calculate backwards from a set finish date | ketanco | Project | 1 | 02-07-2013 06:50 AM |
Backwards Searching Using a Formula | OTPM | Excel | 5 | 05-17-2011 09:17 AM |
Visio 2002 backwards compatible with 2000 | franklyorange | Visio | 0 | 11-17-2008 11:00 AM |