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 Right justify a string

Hi Robert,

Am Fri, 8 Mar 2013 12:18:13 -0700 schrieb Robert Crandal:

s1 = "0000"
s2 = "13"

I would like to copy the contents of s2 and insert it
into s1 in a right justified manner. So, the final
result of s1 would be:

s1 = "0013"


try:
s1 = "0000"
s2 = "13"
s2 = Format(CInt(s2), s1)
MsgBox s2


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