#1
|
|||
|
|||
Modify vba code to print based on name in the InputBox
Hi All
I need some help in modifying the vba code below so that it only prints a task sheet for the resource entered in the InputBox. I have tried and failed miserably. Any help would be appreciated. Tony Dim r As Resource Dim ind As String Dim myString As String ViewApply Name:="Print Task Sheets For NHS Staff" ind = InputBox("Enter Resource Name to print...") If Response = "All" Then GoTo PrintAllResourceSheets Else: GoTo PrintIndividualResourceSheets End If 'Code to print all Resource Sheets PrintAllResourceSheets: For Each r In ActiveProject.Resources If r.Group = "NHS" Then If r.Assignments.Count > 0 Then myString = r.Name FilterEdit Name:="Filter 1", TaskFilter:=True, Create:=True, _ OverwriteExisting:=True, FieldName:="Resource Names", test:="Contains exactly", _ Value:=myString, ShowInMenu:=True, ShowSummaryTasks:=False FilterApply "Filter 1" 'Display Resource Name on each task sheet printed FilePageSetupHeader Alignment:=pjRight, Text:="Resource Name: " & r.Name SelectAll ' ZoomTimescale Selection:=True SendKeys "{ENTER}" FilePrintSetup "PDFCreator:" FilePrintPreview End If End If Next r |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
vba Code to Print Spreadsheet to PDF | OTPM | Excel Programming | 3 | 05-25-2011 08:22 AM |
VBA Code to Print Individual Resource Lists to a pdf File | OTPM | Project | 0 | 05-24-2011 12:21 PM |
How to modify the citation format | MREGLIER | Word | 0 | 02-19-2011 03:31 AM |
Disable/Modify MOC.exe | worthydaydream | Office | 3 | 04-23-2010 10:43 AM |
Modify an AppointmentItem in someone else's Calendar | humpra | Outlook | 1 | 10-16-2009 03:35 AM |