Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
WHEN I TOTAL A COLUMN I GET A RESULT IN WRONG FORMAT | Excel Worksheet Functions | |||
Using VLookup and format the #N/A result | Excel Discussion (Misc queries) | |||
Conditionally format on result ranges | Excel Worksheet Functions | |||
Strange Result using custom number format | Excel Discussion (Misc queries) | |||
Format of textbox on userform and correct result | Excel Programming |