Sivart
03-17-2016, 08:30 PM
First post here. I have used my very strong Google-fu for almost ten hours no and haven't found an answer.
I am working for a Japanese company that has some odd reporting requests. I have made ways to meet this requirement but I am looking for a better way.
I have categories in a text column. When I group by these categories I want to extract an array with two pieces of info. Posting code from home by memory so it is close but not exact.
Dim tmparray() as variant
dim t as task
dim ts as tasks
Dim i as integer
I=0
groupby "text1"
outlinelevel1 'so it only shows group headers
selectall
set ts =activeselection.tasks
for each t in ts
If t is not nothing then
Tmpname=t.name
Tmppercent=t.percentcomplete
tmparray(i)= tmpname & "|" & tmppercent
I=i+1
Endif
next t
i understand this code may not be perfect I can clean it up in the morning. The problem is it only does the tasks and skips the group headers.
I also tried looping selectrow with a rowcounter and it jumped all over the place.
The one time I got it to select the right cell it would only return "True" for both cells not the data contained.
Hopefully this makes sense what I am trying to do. I cannot post the file due to NDA and security requirements on my computer(can't be online even)
If I can get the data into a string or array I can take it from there.
Any help is appreciated and I apologize again for not being able to provide better info.
I am working for a Japanese company that has some odd reporting requests. I have made ways to meet this requirement but I am looking for a better way.
I have categories in a text column. When I group by these categories I want to extract an array with two pieces of info. Posting code from home by memory so it is close but not exact.
Dim tmparray() as variant
dim t as task
dim ts as tasks
Dim i as integer
I=0
groupby "text1"
outlinelevel1 'so it only shows group headers
selectall
set ts =activeselection.tasks
for each t in ts
If t is not nothing then
Tmpname=t.name
Tmppercent=t.percentcomplete
tmparray(i)= tmpname & "|" & tmppercent
I=i+1
Endif
next t
i understand this code may not be perfect I can clean it up in the morning. The problem is it only does the tasks and skips the group headers.
I also tried looping selectrow with a rowcounter and it jumped all over the place.
The one time I got it to select the right cell it would only return "True" for both cells not the data contained.
Hopefully this makes sense what I am trying to do. I cannot post the file due to NDA and security requirements on my computer(can't be online even)
If I can get the data into a string or array I can take it from there.
Any help is appreciated and I apologize again for not being able to provide better info.