PC Review


Reply
Thread Tools Rate Thread

Combine two cells without losing data cell formats

 
 
johncaleb
Guest
Posts: n/a
 
      6th May 2010
I need a macro, or a function to combine 2 columns of data into one column
WITHOUT losing the text-justification of each. See below.

what i have: 1st column is left-justified text. 2nd column is
right-justified text.

[john ][ smith]
[sam ][ williams]
[antwane][ carlson]

what i need in each cell, which is no larger than a cell width of 88.14 or
622pixels :

[john smith]
[sam williams]
[antwane carlson]


if i concatenate, i get the below which is not what i need:
[john smith ]
[sam williams ]
[antwane carlson ]


can i put another formula in to justify all last names to the right in one
cell? maybe take the difference between the number of text that can fit into
cell width of 88.14, and the total amount of text from both cells and space
that amount in between the result?? I don't really know...maybe overthinking
it.

Please help
thx!!


 
Reply With Quote
 
 
 
 
FSt1
Guest
Posts: n/a
 
      6th May 2010
hi
didn't like the answers you got on 5/3, huh.
oh well.
not possible. a cell cannot be both left justified AND right justified.
but if you want, try this.
in C2, concatinate cells A2 and B2. copy and paste special values. adjust
the cell width to your liking. add spaces in between the names to your
lilking. then in the cell below enter this formula.
=A3&REPT(" ",LEN(C2)-(LEN(A3)+LEN(B3)))&B3
copy down.
the above formula uses C2 as a standard number of cells to add spaces to the
cell below. but it probably wont be exact widths. where as spaces will all be
the same width, other characters are not. compare a W to an I. so the results
will be an approximate to what you want.
when done, copy the whole column and paste special values.

Regards
FS1t

"johncaleb" wrote:

> I need a macro, or a function to combine 2 columns of data into one column
> WITHOUT losing the text-justification of each. See below.
>
> what i have: 1st column is left-justified text. 2nd column is
> right-justified text.
>
> [john ][ smith]
> [sam ][ williams]
> [antwane][ carlson]
>
> what i need in each cell, which is no larger than a cell width of 88.14 or
> 622pixels :
>
> [john smith]
> [sam williams]
> [antwane carlson]
>
>
> if i concatenate, i get the below which is not what i need:
> [john smith ]
> [sam williams ]
> [antwane carlson ]
>
>
> can i put another formula in to justify all last names to the right in one
> cell? maybe take the difference between the number of text that can fit into
> cell width of 88.14, and the total amount of text from both cells and space
> that amount in between the result?? I don't really know...maybe overthinking
> it.
>
> Please help
> thx!!
>
>

 
Reply With Quote
 
FSt1
Guest
Posts: n/a
 
      6th May 2010
afterthought,
you might get around the varing character width by changing to a different
font.
try font courier.

Regards
FSt1

"FSt1" wrote:

> hi
> didn't like the answers you got on 5/3, huh.
> oh well.
> not possible. a cell cannot be both left justified AND right justified.
> but if you want, try this.
> in C2, concatinate cells A2 and B2. copy and paste special values. adjust
> the cell width to your liking. add spaces in between the names to your
> lilking. then in the cell below enter this formula.
> =A3&REPT(" ",LEN(C2)-(LEN(A3)+LEN(B3)))&B3
> copy down.
> the above formula uses C2 as a standard number of cells to add spaces to the
> cell below. but it probably wont be exact widths. where as spaces will all be
> the same width, other characters are not. compare a W to an I. so the results
> will be an approximate to what you want.
> when done, copy the whole column and paste special values.
>
> Regards
> FS1t
>
> "johncaleb" wrote:
>
> > I need a macro, or a function to combine 2 columns of data into one column
> > WITHOUT losing the text-justification of each. See below.
> >
> > what i have: 1st column is left-justified text. 2nd column is
> > right-justified text.
> >
> > [john ][ smith]
> > [sam ][ williams]
> > [antwane][ carlson]
> >
> > what i need in each cell, which is no larger than a cell width of 88.14 or
> > 622pixels :
> >
> > [john smith]
> > [sam williams]
> > [antwane carlson]
> >
> >
> > if i concatenate, i get the below which is not what i need:
> > [john smith ]
> > [sam williams ]
> > [antwane carlson ]
> >
> >
> > can i put another formula in to justify all last names to the right in one
> > cell? maybe take the difference between the number of text that can fit into
> > cell width of 88.14, and the total amount of text from both cells and space
> > that amount in between the result?? I don't really know...maybe overthinking
> > it.
> >
> > Please help
> > thx!!
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
combine cells with different formats Truong Microsoft Excel Misc 4 17th May 2009 06:21 PM
& to combine cells/Keep formats jlclyde Microsoft Excel Misc 1 19th Nov 2008 08:23 PM
combine data in two cells into a third cell ordnance1 Microsoft Excel Worksheet Functions 3 25th Sep 2008 07:49 AM
How to combine 2 cells' data into 1 cell? athatisme4@gmail.com Microsoft Excel Charting 1 12th Oct 2005 02:54 AM
How to combine 2 cells' data into 1 cell? athatisme4@gmail.com Microsoft Excel Discussion 3 12th Oct 2005 02:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:31 PM.