#1   Report Post  
Posted to microsoft.public.excel.misc
ML ML is offline
external usenet poster
 
Posts: 57
Default pdf file

I have read a few of your posts but not sure if any of those implied to what
I needed. Here's my question

I have about 20 worksheets/tabs in my workbook. I want to print/save them
in pdf format. All will be saved in the same location but each will have its
own file name base on the tab name (Dept A, Dept B, Dept C, etc). Can this
be possibly done? Please help.

Thanks,
ml
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default pdf file

Assuming you are running Excel 2007

Sub Save_Sheets_As_PDF()
Dim w As Worksheet
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each w In ActiveWorkbook.Worksheets
w.Copy
With ActiveWorkbook
.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:="C:\Program Files\Microsoft Office\2007exceldata" _
& "\" & w.Name & ".pdf"
.Close
End With
Next w
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Thu, 9 Jul 2009 06:27:01 -0700, ml wrote:

I have read a few of your posts but not sure if any of those implied to what
I needed. Here's my question

I have about 20 worksheets/tabs in my workbook. I want to print/save them
in pdf format. All will be saved in the same location but each will have its
own file name base on the tab name (Dept A, Dept B, Dept C, etc). Can this
be possibly done? Please help.

Thanks,
ml


  #3   Report Post  
Posted to microsoft.public.excel.misc
ML ML is offline
external usenet poster
 
Posts: 57
Default pdf file

Thank you so much! Works like a charm.

"Gord Dibben" wrote:

Assuming you are running Excel 2007

Sub Save_Sheets_As_PDF()
Dim w As Worksheet
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each w In ActiveWorkbook.Worksheets
w.Copy
With ActiveWorkbook
.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:="C:\Program Files\Microsoft Office\2007exceldata" _
& "\" & w.Name & ".pdf"
.Close
End With
Next w
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Thu, 9 Jul 2009 06:27:01 -0700, ml wrote:

I have read a few of your posts but not sure if any of those implied to what
I needed. Here's my question

I have about 20 worksheets/tabs in my workbook. I want to print/save them
in pdf format. All will be saved in the same location but each will have its
own file name base on the tab name (Dept A, Dept B, Dept C, etc). Can this
be possibly done? Please help.

Thanks,
ml



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default pdf file

Glad to help.

Thanks for the feedback


Gord

On Mon, 13 Jul 2009 09:55:01 -0700, ml wrote:

Thank you so much! Works like a charm.

"Gord Dibben" wrote:

Assuming you are running Excel 2007

Sub Save_Sheets_As_PDF()
Dim w As Worksheet
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each w In ActiveWorkbook.Worksheets
w.Copy
With ActiveWorkbook
.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:="C:\Program Files\Microsoft Office\2007exceldata" _
& "\" & w.Name & ".pdf"
.Close
End With
Next w
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Thu, 9 Jul 2009 06:27:01 -0700, ml wrote:

I have read a few of your posts but not sure if any of those implied to what
I needed. Here's my question

I have about 20 worksheets/tabs in my workbook. I want to print/save them
in pdf format. All will be saved in the same location but each will have its
own file name base on the tab name (Dept A, Dept B, Dept C, etc). Can this
be possibly done? Please help.

Thanks,
ml




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
File:1 and File:2 -- Double Files when Opening One File dallin Excel Discussion (Misc queries) 1 January 25th 07 02:53 AM
I saved file A over file B. Can I get file B back? Lynn Excel Discussion (Misc queries) 2 May 12th 06 11:24 AM
opening an excel file opens a duplicate file of the same file skm Excel Discussion (Misc queries) 1 December 7th 05 05:52 PM
I SAVED A FILE OVER ANOTHER A FILE IN EXCEL. THE OLD FILE WAS AN . DUFFER8MCD Excel Discussion (Misc queries) 1 December 23rd 04 11:32 PM
i received a file that reads powerpoint document file file exten. CCAROLACEREC Excel Discussion (Misc queries) 1 December 4th 04 05:02 PM


All times are GMT +1. The time now is 12:10 PM.

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

About Us

"It's about Microsoft Excel"