Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

right align columns in a printout

Posted on 2002-04-23
7
Medium Priority
?
227 Views
Last Modified: 2011-10-03
I have created some printouts for a client of mine and I'd like to right align some of the output in the columns.

How would I do this? With some sort of formatting? Could someone provide a very simple example?

Thanks much in advance.
0
Comment
Question by:samic400
  • 3
  • 2
  • 2
7 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6962404
Before any answer can be suggested, we MUST know how and what do you print?
CHeers
0
 
LVL 2

Accepted Solution

by:
corvanderlinden earned 200 total points
ID: 6962435
You could use

format("ww", "@@@@@@@@") -> '      ww'
format(123 , "@@@@@@@@") -> '     123'
 
0
 
LVL 2

Expert Comment

by:corvanderlinden
ID: 6962440
Or
right$("       " & "ww", 7)
the number of spaces equals 7
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Author Comment

by:samic400
ID: 6962455
It will be integers,dollars or percentages. I'd like it look like so -

test          7
test2        12
test3       450

or

test        12.35
test2        1.23
test3      332.78
0
 
LVL 13

Author Comment

by:samic400
ID: 6962456
didn't come out the way I typed it, but angelIII I think you get the idea now, right?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6962494
I think corvanderlinden's suggestion are fine, as long as the font has a equal width for all the caracters. If not, you will eventually need an function that determines the width of the text using a particular font, and then you can determine it's absolute position...

What i wanted to know it rather how you are printing (using your own print commands, using form.print, "printing" to a textbox, printing using MSWord etc).
Depending on this, the answer might differ.

CHeers
0
 
LVL 13

Author Comment

by:samic400
ID: 6962510
Thanks for the input too AngelIII. I should have said that I'm using the printer.print command.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

926 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