Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Exporting Worksheets from a workbook and saving them as a .prn file

i have over 200 worksheets with different names on a workbook. I would
like to move each worksheet to a separate workbook, and save the
workbook as a formatted text (space delimited) file i.e a .prn file
using the same name it had as a worksheet in the original workbook to
a any specified folder.

This way i would have 200 worksheets in the original workbook saved as
different .prn files in the specified folder all at the click of a
button.

Would really appreciate any help guys.

Thanks i anticipation
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default Exporting Worksheets from a workbook and saving them as a .prn file

The follwing code will do.This macro will save the files in the
original workbook's folder.To change it edit the "Thisworkbook.Path"
portion with your path.

I must mention FileFormat of excel does not mention any thing like PRN
so I have used xlTextMSDOS.Hope this will fulfill your reqirement.

--------------------------------
Sub SheetSaveTextFile()

Dim sh As Worksheet, stt As String

Application.ScreenUpdating = False

For Each sh In ThisWorkbook.Worksheets
stt = sh.Name
sh.Copy
ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "/" & stt &
".prn", FileFormat:=xlTextMSDOS
ActiveWorkbook.Close False
Next sh

Application.ScreenUpdating = True

End Sub

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
Exporting Worksheets from a workbook and saving them as a .prn file Ayobami Adeloye Excel Programming 0 September 1st 10 09:46 AM
Help saving file; exporting as .csv cottage6 Excel Programming 2 September 12th 07 07:32 PM
Exporting to a CSV file from multiple worksheets Neale[_2_] Excel Programming 0 May 31st 07 02:47 PM
Exporting Access data to different worksheets on the same workbook chill[_2_] Excel Programming 1 December 5th 03 12:14 PM
Help exporting worksheets/data to a workbook. Tbird Excel Programming 2 October 22nd 03 07:18 PM


All times are GMT +1. The time now is 02:58 AM.

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"