Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to convert text | Excel Discussion (Misc queries) | |||
convert a formula into a macro | Excel Discussion (Misc queries) | |||
Convert Macro ..... | Excel Programming | |||
Convert to .PDF macro | Excel Programming | |||
Using Macro to convert 240 to PRN | Excel Programming |