Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have twelve workbooks that each contain 2 worksheets. One worksheet
contains data and the other contains a chart. Is there a way that I can call up the individual workbooks and then print out just the chart tab, save and call up the next workbook. All this done with one Macro. Thanks Frank |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Little doubt that it could be done. You could write code that lists all
workbook's complete paths/names and have it open them one at a time, find a sheet with a chart on it (be nice if chart sheets all had same name), and print the sheet within a loop. Another way would be to have only those files in a specific folder and have your macro simply access each .xls file in the folder in turn (except for itself) and then do same process regarding finding the chart sheet(s) and printing them. "Beep Beep" wrote: I have twelve workbooks that each contain 2 worksheets. One worksheet contains data and the other contains a chart. Is there a way that I can call up the individual workbooks and then print out just the chart tab, save and call up the next workbook. All this done with one Macro. Thanks Frank |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
give this one a try.
run this, then a dialog comes up and select a folder that has your files. I presume your files are in a same folder. this would try to print every graph in workbooks in the folder, as i'm not sure your graphs are in worksheets or in graph sheet. Sub printcharts() Dim wb, fd Dim sh As Worksheet Dim chobj As ChartObject Dim ch As Chart Dim xlFile As String Dim MyPath As String Set fd = Application.FileDialog(msoFileDialogFolderPicker) If fd.Show = -1 Then MyPath = fd.SelectedItems(1) Else Exit Sub End If ChDir MyPath xlFile = Dir("*.xls") On Error Resume Next Application.DisplayAlerts = False Do While xlFile < "" If ThisWorkbook.Name < xlFile Then Set wb = Workbooks.Open(MyPath & _ Application.PathSeparator & xlFile) End If 'print every worksheets that have graphs For Each sh In worksheets Set chobj = Nothing Set chobj = sh.ChartObjects(1) If Not chobj Is Nothing Then sh.PrintOut 'preview:=True End If Next 'print every Graph sheets For Each ch In Charts ch.PrintOut 'preview:=True Next wb.Close SaveChanges:=False xlFile = Dir Loop End Sub keizi "Beep Beep" wrote in message ... I have twelve workbooks that each contain 2 worksheets. One worksheet contains data and the other contains a chart. Is there a way that I can call up the individual workbooks and then print out just the chart tab, save and call up the next workbook. All this done with one Macro. Thanks Frank |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Print charts in a 30 tab workbook | Charts and Charting in Excel | |||
Print Specific Charts | Charts and Charting in Excel | |||
1 of 4 charts won't print | Charts and Charting in Excel | |||
1 of 4 charts on page won't print | Charts and Charting in Excel | |||
Need Help w/ Print Macro to Print All Visible Sheets (including Charts) in a Workbook | Excel Programming |