print certain tabs

abenitez77

Board Regular
Joined
Dec 30, 2004
Messages
149
I want to print all the xls files in a particular folder and I want to only print out these tabs:
Debit, Letter, Claim, Detail and Support. They should go to the default printer. How do i do this?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
I want to print all the xls files in a particular folder and I want to only print out these tabs:
Debit, Letter, Claim, Detail and Support. They should go to the default printer. How do i do this?

FYI...i would like to do this with a vbscript...
 
Upvote 0
I started with this.... I am getting an error msg on line 26."expected end of statement".

Const strSourcePath = "C:\Documents and Settings\abenit01\Desktop\Document\XLS"
Dim objFSO
Dim objExcel
Dim objWorkbook
Dim objSheet
Dim objFolder
Dim colFiles
Dim objFile
Dim ws

Set objExcel = CreateObject("Excel.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(strSourcePath)
Set colFiles = objFolder.Files
For Each objFile in colFiles
' Open the Excel File for Printing
Set objWorkbook = objExcel.Workbooks.Open(objFile)

For Each ws In objWorkbook.worksheets
If ws.Name Like "Debit Memo" Then ws.PrintOut
If ws.Name Like "Letter" Then ws.PrintOut
If ws.Name Like "Claim Schedule" Then ws.PrintOut
If ws.Name Like "Claim Detail" Then ws.PrintOut
If ws.Name Like "Claim Support" Then ws.PrintOut
Next ws

objWorkbook.Close
End If
Next
Set objSheet = Nothing
Set objWorkbook = Nothing
objExcel.Application.Quit
Set objExcel = Nothing
 
Upvote 0
Just start recording a macro, select the sheets, print, stop recording. No need to dive into the code.

Sheets(Array("Transportation", "Packaging")).Select
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,183
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top