Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add spaces to cell
I am concatenating last and first names into a single cell but need to
have the phantom columns line up. I know the longest last name is 17 characters long so I need a macro which will add the appropriate number of spaces to the right of each last name. Something like -edit cell -calculate length -add appropriate number of spaces to right of last character -end edit -next cell Any help would be great. Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add spaces to cell
using functions not vb
if names in column a formula in b1 =LEFT(A1&" ",17) this adds 17 spaces to the name, then returns the left 17 characters of this new string. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add spaces to cell
Works great,thanks
philcud wrote: using functions not vb if names in column a formula in b1 =LEFT(A1&" ",17) this adds 17 spaces to the name, then returns the left 17 characters of this new string. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add spaces to cell
=A1&REPT(" ",17-LEN(A1))&B1
you will also need a proportional font otherwise letter size throws it. -- HTH Bob Phillips "philcud" wrote in message oups.com... using functions not vb if names in column a formula in b1 =LEFT(A1&" ",17) this adds 17 spaces to the name, then returns the left 17 characters of this new string. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add spaces to cell
Thanks, was about to write back that I needed a font that would print
spaces at same width as letters. Have looked through ones installed but no luck. Any suggestions? Bob Phillips wrote: =A1&REPT(" ",17-LEN(A1))&B1 you will also need a proportional font otherwise letter size throws it. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add spaces to cell
Courier New
You want a monospaced font, not a proportional font. -- Regards, Tom Ogilvy "noyb" wrote in message ... Thanks, was about to write back that I needed a font that would print spaces at same width as letters. Have looked through ones installed but no luck. Any suggestions? Bob Phillips wrote: =A1&REPT(" ",17-LEN(A1))&B1 you will also need a proportional font otherwise letter size throws it. |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add spaces to cell
Thanks again, missed it because of how it shows on screen. Prints fine
though. Tom Ogilvy wrote: Courier New You want a monospaced font, not a proportional font. |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add spaces to cell
-- HTH Bob Phillips "Tom Ogilvy" wrote in message ... Courier New You want a monospaced font, not a proportional font. -- Regards, Tom Ogilvy "noyb" wrote in message ... Thanks, was about to write back that I needed a font that would print spaces at same width as letters. Have looked through ones installed but no luck. Any suggestions? Bob Phillips wrote: =A1&REPT(" ",17-LEN(A1))&B1 you will also need a proportional font otherwise letter size throws it. |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add spaces to cell
Oops, meant the non-proportional.
-- HTH Bob Phillips "Tom Ogilvy" wrote in message ... Courier New You want a monospaced font, not a proportional font. -- Regards, Tom Ogilvy "noyb" wrote in message ... Thanks, was about to write back that I needed a font that would print spaces at same width as letters. Have looked through ones installed but no luck. Any suggestions? Bob Phillips wrote: =A1&REPT(" ",17-LEN(A1))&B1 you will also need a proportional font otherwise letter size throws it. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do I remove leading spaces and leave the remianing spaces w | Excel Worksheet Functions | |||
how do I delete the last two spaces in a cell | Excel Discussion (Misc queries) | |||
Adding spaces to a cell | Excel Discussion (Misc queries) | |||
Remove all spaces in a cell... | Excel Worksheet Functions | |||
Removing Spaces in a Cell | Excel Worksheet Functions |