How to print a sheet based on criteria of a group of cells

rickadams

New Member
Joined
Feb 11, 2018
Messages
31
Hi,
I am attempting to print volunteer sign in sheets based on active volunteers and not print the sheets for inactive ones. The organization can have up to 50 volunteers on the roster for bi weekly time and may only have 6-10 active during a given 2 week period. We need to track their hours because some are here for community service and some are here for CEU time.
If a particular volunteer is on the schedule I click a box next to their name with a “Y” and not active I enter “N”. I only want the 2 week sheets (all on 1 page) to print if the Active is “Y”.
First name stored in K12:K65, last Names are stored L12:L65 in a sort-able list Active or inactive criteria is stored in cells O12:O65
Each sheet populates with their first and last name and id number and the time sheet is now manually printed by sequence number.
FirstLastID #ActiveSEQUENCE
JANEDOE125Y10
NOT HERE126N11

<tbody>
</tbody>
ETC



















Bi Weekly Time Sheet

<tbody>
</tbody>
Name:JANEDOEVolunteer Number125
Other Period
Week 1: January 21, 2019January 27, 2019
Morning HoursAfternoon HoursTotal HoursOffice Use Only
ROUND TO 1/4 HOURTime In Time OutTime In Time OutRegular Overtime
Monday1/21
Tuesday1/22
Wednesday1/23
Thursday1/24
Friday1/25
Saturday1/26
Sunday1/27
Totals
Time sheet must be filled out daily.
Week 2 :January 28, 2019February 3, 2019
Morning HoursAfternoon HoursTotal HoursOffice Use Only
ROUND TO 1/4 HOURTime In Time OutTime In Time OutRegular Overtime
Monday1/28
Tuesday1/29
Wednesday1/30
Thursday1/31
Friday2/1
Saturday2/2
Sunday2/3
Totals
Hours Total – Week 1 and 2
Signatures
Volunteer DateDepartment SupervisorDate
Supervisor DateOther DepartmentDate
TIME SHEET MUST BE SIGNED.

<tbody>
</tbody>


Thank you for your help.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
I think what I would do would be to
1. create an index / roster of the ACTIVE ones, then
2. make that named list a data validation (drop down) cell that you can reference via VBA code.

Here is some code I used once that printed a set of pdfs based on a Data-Validation (drop down list) in cell E3 of NameOfSheet). Hope this helps!

Sub NameOfSub()
Dim FolderName As String, fName As String
Dim inputRange As Range, r As Range, c As Range


Application.ScreenUpdating = False
'''' Open file dialog and choose folder
With Application.FileDialog(msoFileDialogFolderPicker)
.AllowMultiSelect = False
If .Show = True Then
FolderName = .SelectedItems(1) & ""
Else
Exit Sub
End If
End With


'''' Location of DataValidation cell
Set r = Worksheets("NameOfSheet").Range("e3")
'''' Get DataValidation values
Set inputRange = Evaluate(r.Validation.Formula1)


'''' Loop through DataValidation list
For Each c In inputRange

If c.Value = "" Then
c.Value = "NoProgramName"
Else
End If

r.Value = c.Value
fName = c.Value
'''' Save as pdf
Sheets("Dashboard").ExportAsFixedFormat Type:=xlTypePDF, Filename:=FolderName & fName, _
Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
Next c
Application.ScreenUpdating = True
End Sub

Hi,
I am attempting to print volunteer sign in sheets based on active volunteers and not print the sheets for inactive ones.
 
Upvote 0
CatyH, I feel bad because I did not thank you For some reason I did not see your response until I looked up my posts. Thank you so much I will try your suggestion!
 
Last edited:
Upvote 0
CatyH,...
No worries - probably just a setting somewhere. Happens to me all the time on my cell ;) but do let me know how it works - someone on this forum helped me with that very code (and more recently with a different conundrum) so I like to help if I can. This forum is an amazing place to swap ideas and get help!
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,323
Members
449,077
Latest member
jmsotelo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top