Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greetings,
I have a list with about 36 names on Sheet 1. (Each of these name corresponds to a sheet with the same name in the workbook.) Next t each name on the list, I have entered a formula to show the wor "PRINT" if any data is present on that sheet or leave the cell blank i no data is present. I am currently using a For Each ... Then loop t scan the aforementioned range of cells so that if the word "PRINT appears next to the sheet name, the corresponding worksheet shoul print. However, I cannot figure out how to tell the macro to print th particular worksheet once it finds the word "PRINT". Any pointers ar very much appreciated. Please help! Thanks in advance! Sub PrintMac() For Each c In Worksheets("Sheet1").Range("SALES").Cells If c.Value = "Print" Then Worksheets With c.Font .Bold = True .Italic = True End With End If Next c End Su -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi oakman,
I altered your code slightly and I was able to get it to print th required sheets. See below: Sub PrintMac() For Each c In Worksheets("Sheet1").Range("SALES").Cells If c.Value = "Print" Then Sales_Sht_Name = c.Offset(0, -1).Value With Worksheets With c.Font .Bold = True .Italic = True End With Worksheets(Sales_Sht_Name).PrintOut Copies:=1, Collate:=True End With End If Next c End Sub Regards Seamu -- Message posted from http://www.ExcelForum.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you so much Seamus!
This slight change has made a big difference. Regards Oakman. -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Create Worksheet BUT If It Already Exists... | Excel Discussion (Misc queries) | |||
Printing multiple worksheets only if data exists | Excel Programming | |||
Worksheet Exists... | Excel Programming | |||
How can I tell if a worksheet exists? | Excel Programming | |||
check if worksheet exists | Excel Programming |