?
Solved

Excel to prn

Posted on 2003-03-07
9
Medium Priority
?
930 Views
Last Modified: 2008-02-01
I am trying to create a prn file from Excel cell values...The cells are number formated to two decimal places...The prn file needs to have 2 spaces then an 8 digit number (from the cell values), followed by another 2 spaces and another 8 digit number (also from the cell values)...Excel can't seem to give me the required 2 spaces for the text file...I am using visual basic 6 as a user interface...Still in the process of learning...
0
Comment
Question by:kmckinney6
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 13

Expert Comment

by:cri
ID: 8093295
Do not quite understand what you mean with '8 digit number'. How do you want 1234.56 to be formated ? 00001234 ? 00001235 ? 00123456 ? 12345.56xxxxxx ?

As for fixed width format. Format your cells as required. But I do not recommend it, all it takes is a header title which is too long. Where will you use this file ? Perhaps a *.csv (comma delimited, actually it is the 'list separator delimited file'). Much safer. If you state the purpose perhaps a better solution can be found.
0
 
LVL 13

Expert Comment

by:cri
ID: 8093309
Ooops. As for _space delimited_ files...
0
 

Author Comment

by:kmckinney6
ID: 8093780
In the worksheet, the number ranges (ex. 1234.56 to 123456.78) the cells are formatted as number with two decimal places...It has to be a *.prn file...It's use is that it will be downloaded to a flow computer...i could (i think) use notepad to make the file and chage the .txt to .prn and i think that will work...but it needs to have 2 spaces before the 8 digit number and two spaces after the number(__xxxxxx.xx__xxxxxx.xx)think of it as notepad with four columns 1st is two spaces, 2nd is a number (1 would be 000001.00 or 123456.1234 would be 123456.12)3rd column would as the 1st (2 spaces) and 4th would be as the 2nd column, the number....hope this clearifies what i need...thanks
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 

Author Comment

by:kmckinney6
ID: 8093784
I want to see if visual basic do this automatically when i run the app....getting information from 2 columns from a worksheet to generate the prn file i described above....
0
 
LVL 13

Accepted Solution

by:
cri earned 80 total points
ID: 8094039
Ok, I have a solution, but it is so kludgy you must promise to never disclose you got it from me...

Select your data area, then Format|Cells|Number|Custom 000000.00 , ok
Then select the columns and set width to 11 (8 digits + decimal points + 2 for the distance distance). If your font is too big to show on screen, reduce it or set them to shrink to fit.

Save as prn. Check it. Adapt column width if necessary. As far as I was able to determine the font size does not matter unless it results in ####.

Enjoy.
0
 
LVL 13

Expert Comment

by:cri
ID: 8094042
Consider programing your own export routine. For starters, see http://www.cpearson.com/excel/imptext.htm#Export
0
 

Author Comment

by:kmckinney6
ID: 8094314
I want to see if visual basic do this automatically when i run the app....getting information from 2 columns from a worksheet to generate the prn file i described above....
0
 
LVL 13

Expert Comment

by:cri
ID: 8094376
kmckinney6, do not use the 'Refresh' button, use 'Reload This Question' _link_ at the upper left.
0
 

Author Comment

by:kmckinney6
ID: 8094441
i think this will do it....excellent advice....maybe kludgy, but am well pleased that it worked...thanks
0

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question