Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Select Printing Macro

I have a workbook that contains about 60 timesheets on individual worksheets.
Not all of the worksheets have data filled in if a particular individial
does not work on that day. I print timesheets at the end of each day. What
I would like to do is run a macro that would print only the worksheets if the
date cell has the current date in it. The date cell is B1. I hope this
makes sense.
--
-CRM
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Select Printing Macro

Something like this should be close.

Sub PrintUsedSheets()
Dim wks As Worksheet

For Each wks In Worksheets
If wks.Range("B1").Value = Date Then wks.PrintOut
Next wks
End Sub

--
HTH...

Jim Thomlinson


"saltnsnails" wrote:

I have a workbook that contains about 60 timesheets on individual worksheets.
Not all of the worksheets have data filled in if a particular individial
does not work on that day. I print timesheets at the end of each day. What
I would like to do is run a macro that would print only the worksheets if the
date cell has the current date in it. The date cell is B1. I hope this
makes sense.
--
-CRM

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Select Printing Macro

Jim,
Thanks for the reply. I added the macro and nothing happened when I ran it.
not sure what to do. Any other thoughts?

-
-CRM


"Jim Thomlinson" wrote:

Something like this should be close.

Sub PrintUsedSheets()
Dim wks As Worksheet

For Each wks In Worksheets
If wks.Range("B1").Value = Date Then wks.PrintOut
Next wks
End Sub

--
HTH...

Jim Thomlinson


"saltnsnails" wrote:

I have a workbook that contains about 60 timesheets on individual worksheets.
Not all of the worksheets have data filled in if a particular individial
does not work on that day. I print timesheets at the end of each day. What
I would like to do is run a macro that would print only the worksheets if the
date cell has the current date in it. The date cell is B1. I hope this
makes sense.
--
-CRM

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Select Printing Macro

Is your value in Cell B1 and actual date or is it text? To check in some
other cell add
=B1 + 1
which should return the next day if your cell is a true date and not just
text. True dates can also be reformatted.

The other possibility is that your date is actually a date and time strung
together. Try reformatting the date using one of the built in date/time
formats. If the time is anything other than 12AM then you have a date and
time in the cell.

Let me know the results... If it is text then give me an example of the cell
value.
--
HTH...

Jim Thomlinson


"saltnsnails" wrote:

Jim,
Thanks for the reply. I added the macro and nothing happened when I ran it.
not sure what to do. Any other thoughts?

-
-CRM


"Jim Thomlinson" wrote:

Something like this should be close.

Sub PrintUsedSheets()
Dim wks As Worksheet

For Each wks In Worksheets
If wks.Range("B1").Value = Date Then wks.PrintOut
Next wks
End Sub

--
HTH...

Jim Thomlinson


"saltnsnails" wrote:

I have a workbook that contains about 60 timesheets on individual worksheets.
Not all of the worksheets have data filled in if a particular individial
does not work on that day. I print timesheets at the end of each day. What
I would like to do is run a macro that would print only the worksheets if the
date cell has the current date in it. The date cell is B1. I hope this
makes sense.
--
-CRM

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Select Printing Macro

Jim,
Would it be plausible to rewrite the macro so that if cell B1 is greater
than 0, then print?
--
-CRM


"Jim Thomlinson" wrote:

Is your value in Cell B1 and actual date or is it text? To check in some
other cell add
=B1 + 1
which should return the next day if your cell is a true date and not just
text. True dates can also be reformatted.

The other possibility is that your date is actually a date and time strung
together. Try reformatting the date using one of the built in date/time
formats. If the time is anything other than 12AM then you have a date and
time in the cell.

Let me know the results... If it is text then give me an example of the cell
value.
--
HTH...

Jim Thomlinson


"saltnsnails" wrote:

Jim,
Thanks for the reply. I added the macro and nothing happened when I ran it.
not sure what to do. Any other thoughts?

-
-CRM


"Jim Thomlinson" wrote:

Something like this should be close.

Sub PrintUsedSheets()
Dim wks As Worksheet

For Each wks In Worksheets
If wks.Range("B1").Value = Date Then wks.PrintOut
Next wks
End Sub

--
HTH...

Jim Thomlinson


"saltnsnails" wrote:

I have a workbook that contains about 60 timesheets on individual worksheets.
Not all of the worksheets have data filled in if a particular individial
does not work on that day. I print timesheets at the end of each day. What
I would like to do is run a macro that would print only the worksheets if the
date cell has the current date in it. The date cell is B1. I hope this
makes sense.
--
-CRM



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Select Printing Macro

Try this
If wks.Range("B1").Value 0 Then wks.PrintOut
or
If trim(wks.Range("B1").Value) < "" Then wks.PrintOut
--
HTH...

Jim Thomlinson


"saltnsnails" wrote:

Jim,
Would it be plausible to rewrite the macro so that if cell B1 is greater
than 0, then print?
--
-CRM


"Jim Thomlinson" wrote:

Is your value in Cell B1 and actual date or is it text? To check in some
other cell add
=B1 + 1
which should return the next day if your cell is a true date and not just
text. True dates can also be reformatted.

The other possibility is that your date is actually a date and time strung
together. Try reformatting the date using one of the built in date/time
formats. If the time is anything other than 12AM then you have a date and
time in the cell.

Let me know the results... If it is text then give me an example of the cell
value.
--
HTH...

Jim Thomlinson


"saltnsnails" wrote:

Jim,
Thanks for the reply. I added the macro and nothing happened when I ran it.
not sure what to do. Any other thoughts?

-
-CRM


"Jim Thomlinson" wrote:

Something like this should be close.

Sub PrintUsedSheets()
Dim wks As Worksheet

For Each wks In Worksheets
If wks.Range("B1").Value = Date Then wks.PrintOut
Next wks
End Sub

--
HTH...

Jim Thomlinson


"saltnsnails" wrote:

I have a workbook that contains about 60 timesheets on individual worksheets.
Not all of the worksheets have data filled in if a particular individial
does not work on that day. I print timesheets at the end of each day. What
I would like to do is run a macro that would print only the worksheets if the
date cell has the current date in it. The date cell is B1. I hope this
makes sense.
--
-CRM

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 37
Default Select Printing Macro

That did it!!! Thanks Jim!
--
-CRM


"Jim Thomlinson" wrote:

Try this
If wks.Range("B1").Value 0 Then wks.PrintOut
or
If trim(wks.Range("B1").Value) < "" Then wks.PrintOut
--
HTH...

Jim Thomlinson


"saltnsnails" wrote:

Jim,
Would it be plausible to rewrite the macro so that if cell B1 is greater
than 0, then print?
--
-CRM


"Jim Thomlinson" wrote:

Is your value in Cell B1 and actual date or is it text? To check in some
other cell add
=B1 + 1
which should return the next day if your cell is a true date and not just
text. True dates can also be reformatted.

The other possibility is that your date is actually a date and time strung
together. Try reformatting the date using one of the built in date/time
formats. If the time is anything other than 12AM then you have a date and
time in the cell.

Let me know the results... If it is text then give me an example of the cell
value.
--
HTH...

Jim Thomlinson


"saltnsnails" wrote:

Jim,
Thanks for the reply. I added the macro and nothing happened when I ran it.
not sure what to do. Any other thoughts?

-
-CRM


"Jim Thomlinson" wrote:

Something like this should be close.

Sub PrintUsedSheets()
Dim wks As Worksheet

For Each wks In Worksheets
If wks.Range("B1").Value = Date Then wks.PrintOut
Next wks
End Sub

--
HTH...

Jim Thomlinson


"saltnsnails" wrote:

I have a workbook that contains about 60 timesheets on individual worksheets.
Not all of the worksheets have data filled in if a particular individial
does not work on that day. I print timesheets at the end of each day. What
I would like to do is run a macro that would print only the worksheets if the
date cell has the current date in it. The date cell is B1. I hope this
makes sense.
--
-CRM

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing select pages zchuckz New Users to Excel 9 December 15th 06 06:51 PM
Select sheets from an array for printing bennyob Excel Discussion (Misc queries) 2 November 24th 05 01:03 PM
select sheets for printing bennyob Excel Discussion (Misc queries) 1 November 20th 05 02:52 PM
Can I select a worksheet based upon a cell criteria?(for printing) Tim Richards Excel Worksheet Functions 0 March 30th 05 07:03 PM


All times are GMT +1. The time now is 04:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"