View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Nadia Nadia is offline
external usenet poster
 
Posts: 13
Default Need vb application to print first Worksheet in excel files

Thank you for your earlier post.

Should i create this macro within excel and just run it in there rather than
using vb.net to create an actual .exe application?
--
Nadia


"Bernie Deitrick" wrote:

Nadia,

The macro below should do what you want.

HTH,
Bernie
MS Excel MVP

Sub PrintSummaryForUserSelectedFiles()
Dim filearray As Variant
Dim i As Integer
filearray = Application.GetOpenFilename(MultiSelect:=True)
If IsArray(filearray) Then
For i = LBound(filearray) To UBound(filearray)
Workbooks.Open filearray(i)
Worksheets("Summary").PrintOut
ActiveWorkbook.Close False
Next i
Else:
MsgBox "You clicked cancel"
End If
End Sub



"Nadia" wrote in message
...
Hi all and thanks in advance to anyone who helps me.

I have multiple excel workbooks containing 4-5 worksheets each. Each
workbook has a worksheet named "Summary" which summarizes calculations
performed on the other sheets.

I would like to design an application with a "browse" option so that I
select a folder or specific excel file and then click print so that it

will
print only the summary page for the file.

This sounds possible...i apologize if i posted this in the wrong spot.

Any help is appreciated.

--
Nadia