VBA code file format

brandon20

Board Regular
Joined
Feb 12, 2014
Messages
203
Hi,

I have this VBA code to save multiple worksheets into multiple files, it works great.
But it saves them as .prn files as I specified the file format as :xlTextPrinter (which i made bold below)
I was wondering if anyone had the list or link to a list of all vba code file formats that I could pick and choose from to replace xlTextPrinter when needed.
I would like to be able to save things as .txt, .las, .csv


Sub CreateNewWBS()
Dim wbThis As Workbook
Dim wbNew As Workbook
Dim ws As Worksheet
Dim strFilename As String


Set wbThis = ThisWorkbook
For Each ws In wbThis.Worksheets
strFilename = wbThis.Path & "/" & ws.Name
ws.Copy
Set wbNew = ActiveWorkbook
wbNew.SaveAs strFilename, FileFormat:=xlTextPrinter
wbNew.Close
Next ws
End Sub


Thanks
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
if you highlight SAVEAS and press F1 , then click on fileformats, you'll see the list
xlCSV
xlTextMSDOS
xlTextWindows
etc...
 
Upvote 0

Forum statistics

Threads
1,223,171
Messages
6,170,479
Members
452,332
Latest member
The2ndQuest

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top