Format left and right in VBA - TechRepublic
General discussion
December 17, 2009 at 04:51 AM
dgwirb

Format left and right in VBA

by dgwirb . Updated 16 years, 6 months ago

I am finalizing a project using Microsoft Access. A hurdle I am encoutering is the formatting of a process output in Visual Basic. I believe the resolution should be relatively simple, but I cannot locate my answer elsewhere.

I am attempting to format a string of both alpha-numeric and number characters so that regardless of the device it the output is viewed on, it will be formatted in columns. In order to accomplish this, I would like my values to be forced format ‘left’ or ‘right’, whichever is appropriate for that value. Would you know the command needed to accomplish this?

Below is the row of data and the strings to be formatted.
———–
Note: Items in red are meant to be left justified; items in blue are meant to be Left justified.

& “PCG ” & Right(Space(6) & Format([txt70RunP], “+###%;-###%”), 6) & Right(Space(6) & Format([txt70CSL], “###%”), 6) & Right(Space(6) & Format([txt70ASA], “###”), 8) & Chr(13) & Chr(10) _

This discussion is locked

All Comments