Add spaces to cell

  • Thread starter Thread starter noyb
  • Start date Start date
N

noyb

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
 
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.
 
=A1&REPT(" ",17-LEN(A1))&B1

you will also need a proportional font otherwise letter size throws it.
 
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?
 
Thanks again, missed it because of how it shows on screen. Prints fine
though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top