Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-25-2011, 02:03 AM
OTPM OTPM is offline Modify vba code to print based on name in the InputBox Windows 7 32bit Modify vba code to print based on name in the InputBox Office 2010 32bit
Expert
Modify vba code to print based on name in the InputBox
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default 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
Reply With Quote
Reply

Thread Tools
Display Modes


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 vba code to print based on name in the InputBox Modify an AppointmentItem in someone else's Calendar humpra Outlook 1 10-16-2009 03:35 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:45 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft