Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-04-2016, 10:32 AM
blah blah blah blah blah blah is offline VBA - Printing form in excel based on cell value Mac OS X VBA - Printing form in excel based on cell value Office for Mac 2011
Novice
VBA - Printing form in excel based on cell value
 
Join Date: Aug 2016
Posts: 1
blah blah blah is on a distinguished road
Default VBA - Printing form in excel based on cell value

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.
Reply With Quote
  #2  
Old 08-04-2016, 11:22 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline VBA - Printing form in excel based on cell value Windows 7 64bit VBA - Printing form in excel based on cell value Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,920
Pecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond reputePecoflyer has a reputation beyond repute
Default

Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
Reply

Tags
cell value, print, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA - Printing form in excel based on cell value Need help with using traffic lights in one cell based on date value in a different cell wmedjaxnjr Excel 1 04-09-2016 04:22 PM
Hide a combo box (form control), based on a cell value - Excel 2010 jaymudda Excel Programming 9 07-12-2015 10:59 AM
Can anyone here tweek this macro for renaming Excel files based on a cell's contents? chrisd2000 Excel Programming 6 07-01-2014 01:53 PM
VBA - Printing form in excel based on cell value Excel 2007, highlight entire row based on data found in one cell MSofficeBLUE Excel 2 10-15-2013 09:51 PM
Change formula cell range based on cell value Scoth Excel 4 10-25-2012 07:51 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:40 AM.


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