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

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 )
 
A

acw

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
 
P

PeterCheang

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
.
 

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

Top