Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Printing Sheets that only include data

Greetings,

Having posted earlier, I was able to reduce my code thanks to grea
advice from this forum. However I have run into a problem-forgive m
repeating - as before, i have two colums on my Input sheet. The firs
column includes about 36 names that correspond to the sheets in m
workbook. The other column includes a formula to show the word "PRINT
or leave blank, depending on whether there is any data on the shee
with the name on the first column. In addition, I have named the cell
on the second column "UNITS" When i run the macro with the code show
below, I get a "Run-time error '9': Subscrip out of range" and the lin
"Worksheets(Units_Sht_Name).PrintOut Copies:=1, Collate:=True" i
highlighted in yellow.
Any help would be appreciated!

Thank you in advance

Sub printmac
For Each c In Worksheets("Input").Range("UNITS").Cells
If c.Value = "PRINT" Then
Units_Sht_Name = c.Offset(0, -1).Value
With Worksheets
With c.Font
.Bold = True
End With
Worksheets(Units_Sht_Name).PrintOut Copies:=1, Collate:=True
End With
End If
Next c

End Su

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Printing Sheets that only include data

oakman,

That 'subscript out of range' message is because the worksheet

Worksheets(Units_Sht_Name)

cannot be found. Check that all the names on your Input sheet have
corresponding named sheet.

If. for example your Input sheet had the names Smith, Jones and Brow
but there was no sheet named "Brown" in the workbook and the word Prin
appeared beside Brown in the Input sheet - runnung the macro woul
generate the 'subscript out of range' message.

Regards

Seamu

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Printing Sheets that only include data

Seamus,

You are right!
my problem had to do with some of the worksheets that had one lette
difference between what I had in the list on my Input sheet and wha
the actual name of the sheet was. As they say, God is in the details!
Thanks again for your help!
I appreciate your taking the time!

regard

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Printing Sheets that only include data

No problem - thanks for the feedback. I'm only pleased that I have bee
able to help someone else considering the amount of help I hav
received for the experts around here with problems I have had.

regards

Seamu

--
Message posted from http://www.ExcelForum.com

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
Include info from data source in data table but not in chart UHSH Admin Charts and Charting in Excel 1 February 26th 09 05:04 AM
HOw do I include "reminders"on my excel sheets? Armandoso Excel Discussion (Misc queries) 1 April 14th 08 04:44 AM
Printing Form to Include All Options in Excel LostAndConfused New Users to Excel 1 August 10th 07 07:49 PM
Printing sheets. Dabber Excel Worksheet Functions 2 June 5th 05 08:00 PM
Updating sheets to include new data beside old data ian123 Excel Programming 0 November 24th 03 10:37 PM


All times are GMT +1. The time now is 02:22 AM.

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

About Us

"It's about Microsoft Excel"