Hello Folks,
I am trying to do something for a organization I do volunteer work and I can not get my head around this one. We use a excel workbook that contains the names of the volunteers that come to work with us and we provide them a listing of their volunteer hours and and task for each month of the year. We have a workbook that we use for this in the following way:
There are 14 sheets in total, where:
- One sheet has all the volunteer's info (name, address, phone, active volunteer, professional, licensed, task performed etc.). One row per volunteer
- The volunteer summary sheet that summarizes the 12 sheets of the month for one volunteer at a time. This is the sheet that we print out for them
- 12 sheets are where we input all the volunteer hours for each month of the year
So on the volunteer summary sheet we change their ID in cell C5 and we get a beautiful sheet with that individuals information for the year
As volunteers come and go our list continues to grow and we keep their info indefinitely. So our list has grown pretty big and we just can not print everyone's info all the time especially those that are no longer active volunteers (Range E2:E501).
Someone provided the following code to me:
Sub PrintAll_IDs()
For Each myCell In Worksheets(2).Range("L2:L501") 'range with stored ID's
Worksheets(5).Range("C5") = myCell.Value ' "C5" is the cell with ID that we change manually now
Worksheets(5).PrintOut
Next myCell
End Sub
This code works but it prints everything even those volunteers that are no longer active and it will not stop till it is done. Range("E2:E501") and Range("N2:N501") in Worksheets(2) (that is the data sheet with all the volunteer info) contains the info I need to filter out those volunteers that no longer need to be printed out. So I am stumbling around trying to see how I get this to work. Any help will be much appreciated. Sorry for what may be a very simple problem but I am really new at VBA. Thanks folks.