Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Macro to convert CSV to PRN

I know I am not the only one to need this so I was hoping someone could help.

The search engines keep coming up with ABC software that I don't plan on
buying and I can't find any shareware.

I have dozens of CSV files that I need converted to PRN. Does anyone have a
Macro that will do this? I wish I had a batch file to do a list of filenames
but that is asking too much. Thnks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Macro to convert CSV to PRN

do you actually want to change them from comma delimited to fixed column?

Or do you just want to rename them to have a .prn extension?

If fixed column, would they all have the same format?

Or do you just want to load them into excel and then save them as PRN -
however they come out.

for a list of files

Sub listfiles()
Dim rw as Long, sPath as String
Dim sName as String
rw = 2
sPath = "C:\MyDirectory\MySubfolder\"
sName = dir(spath & "*.csv")
do while sName < ""
cells(rw,1) = sName
sName = dir
rw = rw + 1
Loop
End sub


--
Regards,
Tom Ogilvy



"fugazi48" wrote:

I know I am not the only one to need this so I was hoping someone could help.

The search engines keep coming up with ABC software that I don't plan on
buying and I can't find any shareware.

I have dozens of CSV files that I need converted to PRN. Does anyone have a
Macro that will do this? I wish I had a batch file to do a list of filenames
but that is asking too much. Thnks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Macro to convert CSV to PRN

I guess I thought the way our company used PRN data files was standard. Ours
has a special header with numbers telling applications how many variables
there are, how many lines of header there is, and how many samples there are.


I didn't realize a normal PRN was just a CSV with normalized columns or
something.

Excel does put a bunch of extra commas when I tried to make my own macro. I
have to make sure that I delete any blank cells that may have had data in it
at one time to prevent the commas.

"Tom Ogilvy" wrote:

do you actually want to change them from comma delimited to fixed column?

Or do you just want to rename them to have a .prn extension?

If fixed column, would they all have the same format?

Or do you just want to load them into excel and then save them as PRN -
however they come out.

for a list of files

Sub listfiles()
Dim rw as Long, sPath as String
Dim sName as String
rw = 2
sPath = "C:\MyDirectory\MySubfolder\"
sName = dir(spath & "*.csv")
do while sName < ""
cells(rw,1) = sName
sName = dir
rw = rw + 1
Loop
End sub


--
Regards,
Tom Ogilvy



"fugazi48" wrote:

I know I am not the only one to need this so I was hoping someone could help.

The search engines keep coming up with ABC software that I don't plan on
buying and I can't find any shareware.

I have dozens of CSV files that I need converted to PRN. Does anyone have a
Macro that will do this? I wish I had a batch file to do a list of filenames
but that is asking too much. Thnks.

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
Macro to convert text bamf Excel Discussion (Misc queries) 0 April 2nd 07 03:56 PM
convert a formula into a macro Dave F Excel Discussion (Misc queries) 2 December 11th 06 10:34 PM
Convert Macro ..... rvillanueva[_8_] Excel Programming 2 May 2nd 06 07:42 PM
Convert to .PDF macro Ashish[_3_] Excel Programming 1 October 3rd 05 01:46 PM
Using Macro to convert 240 to PRN Kenneth Excel Programming 1 November 9th 03 11:43 PM


All times are GMT +1. The time now is 01:38 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"