View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default String centering

Hi Robert,

Am Tue, 5 Mar 2013 03:00:04 -0700 schrieb Robert Crandal:

s = "iPhone" ' string length is 6

I want to modify the above string variable such that
the string length is 20, AND, the string is centered or
padded with spaces.

The result should look like:

s = " iPhone " ' string length is 20


center your strings with Home tab = Alignment.
If you center your strings with spaces it is hard to find them with
MATCH and other functions.
If you still want do it, look the REPT function


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2