alex1404
08-23-2011, 04:36 AM
hi all,
i'm new here
i need to copy some tasks with the same name from one file to a new file.
i want to do it with userform acordding to a task name that insert by user into a textbox and also to copy only the tasks without there summmry task.
recording macro with filtter didnt help me.
for example: copy task "c"
-a
-b
-c <--
d
-z
c <---
the result is: new file will show
c
c
my code:
Private Sub CommandButton1_Click()
Dim ts As Tasks
Dim t As Task
Dim j As Integer
i = 0
SelectAll
Set ts = ActiveSelection.Tasks
For Each t In ts
If Not t Is Nothing Then
If t.Name = TextBox1.Value And ts.Count >= i Then
SelectRow row:=i
EditCopy
Projects("new").Activate
EditPaste
Projects("project1").Activate
End If
End If
Next t
End Sub
plz help me.
i'm new here
i need to copy some tasks with the same name from one file to a new file.
i want to do it with userform acordding to a task name that insert by user into a textbox and also to copy only the tasks without there summmry task.
recording macro with filtter didnt help me.
for example: copy task "c"
-a
-b
-c <--
d
-z
c <---
the result is: new file will show
c
c
my code:
Private Sub CommandButton1_Click()
Dim ts As Tasks
Dim t As Task
Dim j As Integer
i = 0
SelectAll
Set ts = ActiveSelection.Tasks
For Each t In ts
If Not t Is Nothing Then
If t.Name = TextBox1.Value And ts.Count >= i Then
SelectRow row:=i
EditCopy
Projects("new").Activate
EditPaste
Projects("project1").Activate
End If
End If
Next t
End Sub
plz help me.