Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Format a result

Hi
I'm concatenating several cells into one cell. I need the one value to
display a total of 12 characters long. However, teh cell value may consist
of anywhere from 4 - 12 digits. How can I get the results to display in a
cell to be left aligned, with any unused characters to be displayed as
"spaces" to the right of the digits? (123456789 )

I've tried format(AcctNum, "000000000000"), but it shows all 12 characters
as a number or a zero. (000123456789)

If I use format(AcctNum, "############"), it only shows the characters used,
and no extra characters are entered. If the AcctNum is only 6 characters
long, only 6 characters are used, and I need 12 characters. (123456789)

If I use format(AcctNum, " "), it only enters in 12 spaces,
nothing else. ( )

Thank you.
Fred
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Format a result

Try it this way...

Format(AcctNum, "!@@@@@@@@@@@@")

Rick


"Fred" wrote in message
...
Hi
I'm concatenating several cells into one cell. I need the one value to
display a total of 12 characters long. However, teh cell value may
consist
of anywhere from 4 - 12 digits. How can I get the results to display in a
cell to be left aligned, with any unused characters to be displayed as
"spaces" to the right of the digits? (123456789 )

I've tried format(AcctNum, "000000000000"), but it shows all 12 characters
as a number or a zero. (000123456789)

If I use format(AcctNum, "############"), it only shows the characters
used,
and no extra characters are entered. If the AcctNum is only 6 characters
long, only 6 characters are used, and I need 12 characters. (123456789)

If I use format(AcctNum, " "), it only enters in 12 spaces,
nothing else. ( )

Thank you.
Fred


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Format a result

Dim AcctNum As Long
AcctNum = 1234
MsgBox "**" & Left(AcctNum & Space(12), 12) & "**"


Fred wrote:

Hi
I'm concatenating several cells into one cell. I need the one value to
display a total of 12 characters long. However, teh cell value may consist
of anywhere from 4 - 12 digits. How can I get the results to display in a
cell to be left aligned, with any unused characters to be displayed as
"spaces" to the right of the digits? (123456789 )

I've tried format(AcctNum, "000000000000"), but it shows all 12 characters
as a number or a zero. (000123456789)

If I use format(AcctNum, "############"), it only shows the characters used,
and no extra characters are entered. If the AcctNum is only 6 characters
long, only 6 characters are used, and I need 12 characters. (123456789)

If I use format(AcctNum, " "), it only enters in 12 spaces,
nothing else. ( )

Thank you.
Fred


--

Dave Peterson
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
WHEN I TOTAL A COLUMN I GET A RESULT IN WRONG FORMAT cannotgeitright Excel Worksheet Functions 2 May 21st 10 10:41 AM
Using VLookup and format the #N/A result rvtrails Excel Discussion (Misc queries) 2 March 5th 10 08:33 PM
Conditionally format on result ranges Killashandrah Excel Worksheet Functions 2 May 23rd 07 06:49 AM
Strange Result using custom number format sfrancoe2 Excel Discussion (Misc queries) 0 January 10th 06 05:07 PM
Format of textbox on userform and correct result Mark Excel Programming 1 July 13th 04 02:49 PM


All times are GMT +1. The time now is 08:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"