Need VBA code help on columns to text without loosing the format.

  • Thread starter Thread starter PeterCheang
  • Start date Start date
P

PeterCheang

I have column A width 40 characters,column B width 6
characters,and column C,D,E,F,G,H are width 20 characters.
I want concatenate them become a text without loosing the
above format.(e.g :F50:20
0 MAH-01-101 AIR
FLOW
HIGH SCALING FACTOR )
 
Peter

Try this - adjust range to suit.

=MID(A29&REPT(" ",40),1,40)&MID(B29&REPT(" ",6),1,6) & MID
(C29&REPT(" ",20),1,20)& MID(D29&REPT(" ",20),1,20)& MID
(E29&REPT(" ",20),1,20)& MID(F29&REPT(" ",20),1,20)& MID
(G29&REPT(" ",20),1,20)& MID(H29&REPT(" ",20),1,20)

You could also use the left function instead of the mid.


Tony
 
Tony
Thanks.It worked.
-----Original Message-----
Peter

Try this - adjust range to suit.

=MID(A29&REPT(" ",40),1,40)&MID(B29&REPT(" ",6),1,6) & MID
(C29&REPT(" ",20),1,20)& MID(D29&REPT(" ",20),1,20)& MID
(E29&REPT(" ",20),1,20)& MID(F29&REPT(" ",20),1,20)& MID
(G29&REPT(" ",20),1,20)& MID(H29&REPT(" ",20),1,20)

You could also use the left function instead of the mid.


Tony
.
 
Back
Top