Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need vb application to print first Worksheet in excel files
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need vb application to print first Worksheet in excel files
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need vb application to print first Worksheet in excel files
Nadia,
Generally, since Excel will be used to open the workbooks anyway, it doesn't really matter that much performance wise. If you put the code into a module in a new workbook, then it will work fine. In vb.net, you would need to change the code to use the Excel application object that you would start up when the code started. I would go with the workbook approach, personally. HTH, Bernie MS Excel MVP "Nadia" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Importing data from an application to an Excel worksheet | Excel Discussion (Misc queries) | |||
Excel Files won't open unless from within Excel Application | Excel Discussion (Misc queries) | |||
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet | Excel Worksheet Functions | |||
Excel files wont print. | Charts and Charting in Excel |