Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 144
Default combining 3 cells in 1 on different lines

Hi all,

In cell A2 is a name, say Johnson.
In cell B2 a code, say Ab89-w-5
In cell K2 is a date (in European notation) say 16 september 2009
All in Tmes New Roman 10.
Ik want in cell Q2 this

Johnson
Ab89-w-5
16 september 2009

So - on different lines - the name left aligned en both other data right
aligned (if possible)
Also if possible I would like the name in Times New Roman 10 and in bold,
and the rest in Arial 7 (not bold).

I spent a lot of time on it but I can't figure out what code to use and I
wonder if it is possible at all.
If all is not possible it would be next best if I got the three data below
each other in one cell with Johnson in bold type.
If that also is not possible I will work with the three data below each
other.

I use Excel 2000 (9.0.6926 SP-3)

Your advice will be highly appreciated.

Jack Sons
The Netherlands


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default combining 3 cells in 1 on different lines

You are combining strins and can do it using either the ampersand or the
concatenate function.

=A2&B2&K2

If you need spaces then add the using double quotes

=A2&" "&B2&" "&K2

If K2 is in the wrong format then use the TEXT function

=A2&B2&text(K2,"dd-mm-yy")



"Jack Sons" wrote:

Hi all,

In cell A2 is a name, say Johnson.
In cell B2 a code, say Ab89-w-5
In cell K2 is a date (in European notation) say 16 september 2009
All in Tmes New Roman 10.
Ik want in cell Q2 this

Johnson
Ab89-w-5
16 september 2009

So - on different lines - the name left aligned en both other data right
aligned (if possible)
Also if possible I would like the name in Times New Roman 10 and in bold,
and the rest in Arial 7 (not bold).

I spent a lot of time on it but I can't figure out what code to use and I
wonder if it is possible at all.
If all is not possible it would be next best if I got the three data below
each other in one cell with Johnson in bold type.
If that also is not possible I will work with the three data below each
other.

I use Excel 2000 (9.0.6926 SP-3)

Your advice will be highly appreciated.

Jack Sons
The Netherlands



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default combining 3 cells in 1 on different lines

=A2 & CHAR(10) & B2 & CHAR(10) & TEXT(K2, "dd mmmm yyyy")

Set wrap text and row and column autofit.

The fonts and bolding would have to be done through VBA

Here is some example code............play with it and see what you can come
up with.

Sub CellFont()
With ActiveCell.Characters(Start:=1, Length:=5).Font
.ColorIndex = 3
.Bold = True
.Underline = True
.Size = 14
End With
With ActiveCell.Characters(Start:=6, Length:=3).Font
.Superscript = True
.ColorIndex = 5
End With
With ActiveCell.Characters(Start:=10, Length:=4).Font
.Bold = True
.Size = 18
.ColorIndex = 6
End With
End Sub


Gord Dibben MS Excel MVP

On Sun, 30 Aug 2009 12:08:23 +0200, "Jack Sons" wrote:

Hi all,

In cell A2 is a name, say Johnson.
In cell B2 a code, say Ab89-w-5
In cell K2 is a date (in European notation) say 16 september 2009
All in Tmes New Roman 10.
Ik want in cell Q2 this

Johnson
Ab89-w-5
16 september 2009

So - on different lines - the name left aligned en both other data right
aligned (if possible)
Also if possible I would like the name in Times New Roman 10 and in bold,
and the rest in Arial 7 (not bold).

I spent a lot of time on it but I can't figure out what code to use and I
wonder if it is possible at all.
If all is not possible it would be next best if I got the three data below
each other in one cell with Johnson in bold type.
If that also is not possible I will work with the three data below each
other.

I use Excel 2000 (9.0.6926 SP-3)

Your advice will be highly appreciated.

Jack Sons
The Netherlands


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 144
Default combining 3 cells in 1 on different lines

Joel and Gord,

Thank you both.

The formula I want to do in VBA, I know how.

But, Gord, as I already new, setting the cell content as you adviced will
result in everything in the cell following the characteristics of the first
part, so the whole content becomes red, bold, size 14 and underlined.
That really is my problem.

Any solution?

Jack.


"Gord Dibben" <gorddibbATshawDOTca schreef in bericht
...
=A2 & CHAR(10) & B2 & CHAR(10) & TEXT(K2, "dd mmmm yyyy")

Set wrap text and row and column autofit.

The fonts and bolding would have to be done through VBA

Here is some example code............play with it and see what you can
come
up with.

Sub CellFont()
With ActiveCell.Characters(Start:=1, Length:=5).Font
.ColorIndex = 3
.Bold = True
.Underline = True
.Size = 14
End With
With ActiveCell.Characters(Start:=6, Length:=3).Font
.Superscript = True
.ColorIndex = 5
End With
With ActiveCell.Characters(Start:=10, Length:=4).Font
.Bold = True
.Size = 18
.ColorIndex = 6
End With
End Sub


Gord Dibben MS Excel MVP

On Sun, 30 Aug 2009 12:08:23 +0200, "Jack Sons" wrote:

Hi all,

In cell A2 is a name, say Johnson.
In cell B2 a code, say Ab89-w-5
In cell K2 is a date (in European notation) say 16 september 2009
All in Tmes New Roman 10.
Ik want in cell Q2 this

Johnson
Ab89-w-5
16 september 2009

So - on different lines - the name left aligned en both other data right
aligned (if possible)
Also if possible I would like the name in Times New Roman 10 and in bold,
and the rest in Arial 7 (not bold).

I spent a lot of time on it but I can't figure out what code to use and I
wonder if it is possible at all.
If all is not possible it would be next best if I got the three data below
each other in one cell with Johnson in bold type.
If that also is not possible I will work with the three data below each
other.

I use Excel 2000 (9.0.6926 SP-3)

Your advice will be highly appreciated.

Jack Sons
The Netherlands




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 79
Default combining 3 cells in 1 on different lines

On 31 Ago, 00:05, "Jack Sons" wrote:
Joel and Gord,

Thank you both.

The formula I want to do in VBA, I know how.

But, Gord, as I already new, setting the cell content as you adviced will
result in everything in the cell following the characteristics of the first
part, so the whole content becomes red, bold, size 14 and underlined.
That really is my problem.

Any solution?

Jack.

"Gord Dibben" <gorddibbATshawDOTca schreef in berichtnews:255l95t6vsplv17cls4hp66u7tagbqmc83@4ax .com...



=A2 & CHAR(10) & B2 & CHAR(10) & TEXT(K2, "dd mmmm yyyy")


Set wrap text and row and column autofit.


The fonts and bolding would have to be done through VBA


Here is some example code............play with it and see what you can
come
up with.


Sub CellFont()
* *With ActiveCell.Characters(Start:=1, Length:=5).Font
* * * *.ColorIndex = 3
* * * *.Bold = True
* * * *.Underline = True
* * * *.Size = 14
* *End With
* *With ActiveCell.Characters(Start:=6, Length:=3).Font
* * * *.Superscript = True
* * * *.ColorIndex = 5
* *End With
* *With ActiveCell.Characters(Start:=10, Length:=4).Font
* * * *.Bold = True
* * * *.Size = 18
* * * *.ColorIndex = 6
* *End With
End Sub


Gord Dibben *MS Excel MVP


On Sun, 30 Aug 2009 12:08:23 +0200, "Jack Sons" wrote:


Hi all,


In cell A2 is a name, say Johnson.
In cell B2 *a code, say Ab89-w-5
In cell K2 is a date (in European notation) say 16 september 2009
All in Tmes New Roman 10.
Ik want in cell Q2 this


Johnson
* * * * * * * * *Ab89-w-5
* * 16 september 2009


So - on different lines - the name left aligned en both other data right
aligned (if possible)
Also if possible I would like the name in Times New Roman 10 and in bold,
and the rest in Arial 7 (not bold).


I spent a lot of time on it but I can't figure out what code to use and I
wonder if it is possible at all.
If all is not possible it would be next best if I got the three data below
each other in one cell with Johnson in bold type.
If that also is not possible I will work with the three data below each
other.


I use Excel 2000 (9.0.6926 SP-3)


Your advice will be highly appreciated.


Jack Sons
The Netherlands- Nascondi testo citato


- Mostra testo citato -


Hi Jack.

Gord said:
Here is some example code............play with it and see what you can
come
up with.

You can format values, not formula; so try:

Sub CellFont()
ActiveCell = ActiveCell.Value
With ActiveCell.Characters(Start:=1, Length:=7).Font
..ColorIndex = 3
..Bold = True
..Size = 14
End With
With ActiveCell.Characters(Start:=9, Length:=16).Font
..ColorIndex = 5
End With
With ActiveCell.Characters(Start:=18, Length:=17).Font
..Bold = True
..Size = 18
End With
End Sub

Regards
Eliano


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default combining 3 cells in 1 on different lines

Try this.............

Sub CellFont()
With ActiveSheet.Range("A1")
.Value = Range("A2").Value & " " & Chr(10) & _
Range("B2").Value & " " & Chr(10) & _
Format(Range("K2").Value, "dd mmmm yyyy")
With .Characters(Start:=1, Length:=Len(Range("A2").Value)).Font
.Bold = True
.Size = 10
.Name = "Times New Roman"
End With
With .Characters(Start:=Len(Range("A2").Value) + 2, _
Length:=Len((Range("B2").Value)) + (Range("K2").Value)).Font
'Length:= 100).Font
.Name = "Arial"
.Size = 7
End With
End With
End Sub


Gord


On Mon, 31 Aug 2009 00:05:24 +0200, "Jack Sons" wrote:

Joel and Gord,

Thank you both.

The formula I want to do in VBA, I know how.

But, Gord, as I already new, setting the cell content as you adviced will
result in everything in the cell following the characteristics of the first
part, so the whole content becomes red, bold, size 14 and underlined.
That really is my problem.

Any solution?

Jack.


"Gord Dibben" <gorddibbATshawDOTca schreef in bericht
.. .
=A2 & CHAR(10) & B2 & CHAR(10) & TEXT(K2, "dd mmmm yyyy")

Set wrap text and row and column autofit.

The fonts and bolding would have to be done through VBA

Here is some example code............play with it and see what you can
come
up with.

Sub CellFont()
With ActiveCell.Characters(Start:=1, Length:=5).Font
.ColorIndex = 3
.Bold = True
.Underline = True
.Size = 14
End With
With ActiveCell.Characters(Start:=6, Length:=3).Font
.Superscript = True
.ColorIndex = 5
End With
With ActiveCell.Characters(Start:=10, Length:=4).Font
.Bold = True
.Size = 18
.ColorIndex = 6
End With
End Sub


Gord Dibben MS Excel MVP

On Sun, 30 Aug 2009 12:08:23 +0200, "Jack Sons" wrote:

Hi all,

In cell A2 is a name, say Johnson.
In cell B2 a code, say Ab89-w-5
In cell K2 is a date (in European notation) say 16 september 2009
All in Tmes New Roman 10.
Ik want in cell Q2 this

Johnson
Ab89-w-5
16 september 2009

So - on different lines - the name left aligned en both other data right
aligned (if possible)
Also if possible I would like the name in Times New Roman 10 and in bold,
and the rest in Arial 7 (not bold).

I spent a lot of time on it but I can't figure out what code to use and I
wonder if it is possible at all.
If all is not possible it would be next best if I got the three data below
each other in one cell with Johnson in bold type.
If that also is not possible I will work with the three data below each
other.

I use Excel 2000 (9.0.6926 SP-3)

Your advice will be highly appreciated.

Jack Sons
The Netherlands




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 144
Default combining 3 cells in 1 on different lines

Gord and Eliano,

Thank you both, it worked very well.
Learned again something .

Jack.

"Gord Dibben" <gorddibbATshawDOTca schreef in bericht
...
Try this.............

Sub CellFont()
With ActiveSheet.Range("A1")
.Value = Range("A2").Value & " " & Chr(10) & _
Range("B2").Value & " " & Chr(10) & _
Format(Range("K2").Value, "dd mmmm yyyy")
With .Characters(Start:=1, Length:=Len(Range("A2").Value)).Font
.Bold = True
.Size = 10
.Name = "Times New Roman"
End With
With .Characters(Start:=Len(Range("A2").Value) + 2, _
Length:=Len((Range("B2").Value)) + (Range("K2").Value)).Font
'Length:= 100).Font
.Name = "Arial"
.Size = 7
End With
End With
End Sub


Gord


On Mon, 31 Aug 2009 00:05:24 +0200, "Jack Sons" wrote:

Joel and Gord,

Thank you both.

The formula I want to do in VBA, I know how.

But, Gord, as I already new, setting the cell content as you adviced will
result in everything in the cell following the characteristics of the
first
part, so the whole content becomes red, bold, size 14 and underlined.
That really is my problem.

Any solution?

Jack.


"Gord Dibben" <gorddibbATshawDOTca schreef in bericht
. ..
=A2 & CHAR(10) & B2 & CHAR(10) & TEXT(K2, "dd mmmm yyyy")

Set wrap text and row and column autofit.

The fonts and bolding would have to be done through VBA

Here is some example code............play with it and see what you can
come
up with.

Sub CellFont()
With ActiveCell.Characters(Start:=1, Length:=5).Font
.ColorIndex = 3
.Bold = True
.Underline = True
.Size = 14
End With
With ActiveCell.Characters(Start:=6, Length:=3).Font
.Superscript = True
.ColorIndex = 5
End With
With ActiveCell.Characters(Start:=10, Length:=4).Font
.Bold = True
.Size = 18
.ColorIndex = 6
End With
End Sub


Gord Dibben MS Excel MVP

On Sun, 30 Aug 2009 12:08:23 +0200, "Jack Sons"
wrote:

Hi all,

In cell A2 is a name, say Johnson.
In cell B2 a code, say Ab89-w-5
In cell K2 is a date (in European notation) say 16 september 2009
All in Tmes New Roman 10.
Ik want in cell Q2 this

Johnson
Ab89-w-5
16 september 2009

So - on different lines - the name left aligned en both other data right
aligned (if possible)
Also if possible I would like the name in Times New Roman 10 and in
bold,
and the rest in Arial 7 (not bold).

I spent a lot of time on it but I can't figure out what code to use and
I
wonder if it is possible at all.
If all is not possible it would be next best if I got the three data
below
each other in one cell with Johnson in bold type.
If that also is not possible I will work with the three data below each
other.

I use Excel 2000 (9.0.6926 SP-3)

Your advice will be highly appreciated.

Jack Sons
The Netherlands






  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 79
Default combining 3 cells in 1 on different lines

On 31 Ago, 11:10, "Jack Sons" wrote:
Gord andEliano,

Thank you both, it worked very well.
Learned again something .

Jack.

"Gord Dibben" <gorddibbATshawDOTca schreef in berichtnews:lavl95hna2n4qjes6eoq4v6m903ki4600s@4ax .com...



Try this.............


Sub CellFont()
* *With ActiveSheet.Range("A1")
* * * *.Value = Range("A2").Value & " " & Chr(10) & _
* * * * * * * * Range("B2").Value & " " & Chr(10) & _
* * * * * * * * Format(Range("K2").Value, "dd mmmm yyyy")
* * * *With .Characters(Start:=1, Length:=Len(Range("A2").Value)).Font
* * * * * *.Bold = True
* * * * * *.Size = 10
* * * * * *.Name = "Times New Roman"
* * * *End With
* * * *With .Characters(Start:=Len(Range("A2").Value) + 2, _
* * * * * *Length:=Len((Range("B2").Value)) + (Range("K2").Value)).Font
* * * * * *'Length:= 100).Font
* * * * * *.Name = "Arial"
* * * * * *.Size = 7
* * * *End With
* *End With
End Sub


Gord


On Mon, 31 Aug 2009 00:05:24 +0200, "Jack Sons" wrote:


Joel and Gord,


Thank you both.


The formula I want to do in VBA, I know how.


But, Gord, as I already new, setting the cell content as you adviced will
result in everything in the cell following the characteristics of the
first
part, so the whole content becomes red, bold, size 14 and underlined.
That really is my problem.


Any solution?


Jack.


"Gord Dibben" <gorddibbATshawDOTca schreef in bericht
. ..
=A2 & CHAR(10) & B2 & CHAR(10) & TEXT(K2, "dd mmmm yyyy")


Set wrap text and row and column autofit.


The fonts and bolding would have to be done through VBA


Here is some example code............play with it and see what you can
come
up with.


Sub CellFont()
* *With ActiveCell.Characters(Start:=1, Length:=5).Font
* * * *.ColorIndex = 3
* * * *.Bold = True
* * * *.Underline = True
* * * *.Size = 14
* *End With
* *With ActiveCell.Characters(Start:=6, Length:=3).Font
* * * *.Superscript = True
* * * *.ColorIndex = 5
* *End With
* *With ActiveCell.Characters(Start:=10, Length:=4).Font
* * * *.Bold = True
* * * *.Size = 18
* * * *.ColorIndex = 6
* *End With
End Sub


Gord Dibben *MS Excel MVP


On Sun, 30 Aug 2009 12:08:23 +0200, "Jack Sons"
wrote:


Hi all,


In cell A2 is a name, say Johnson.
In cell B2 *a code, say Ab89-w-5
In cell K2 is a date (in European notation) say 16 september 2009
All in Tmes New Roman 10.
Ik want in cell Q2 this


Johnson
* * * * * * * * *Ab89-w-5
* * 16 september 2009


So - on different lines - the name left aligned en both other data right
aligned (if possible)
Also if possible I would like the name in Times New Roman 10 and in
bold,
and the rest in Arial 7 (not bold).


I spent a lot of time on it but I can't figure out what code to use and
I
wonder if it is possible at all.
If all is not possible it would be next best if I got the three data
below
each other in one cell with Johnson in bold type.
If that also is not possible I will work with the three data below each
other.


I use Excel 2000 (9.0.6926 SP-3)


Your advice will be highly appreciated.


Jack Sons
The Netherlands- Nascondi testo citato


- Mostra testo citato -


Hi Jack.
Thanks to Gord; I've only played with his indications.
Regards
Eliano
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining Cells Fredgus Excel Discussion (Misc queries) 3 December 18th 08 07:23 PM
Need help with combining cells to one Coolquicc Excel Discussion (Misc queries) 3 September 10th 08 11:08 PM
Combining and merging lines Dawn Excel Discussion (Misc queries) 1 January 3rd 08 03:44 PM
combining 3D with lines soph Charts and Charting in Excel 3 September 15th 06 08:54 AM
combining cells lyneday Excel Discussion (Misc queries) 2 December 3rd 04 05:45 PM


All times are GMT +1. The time now is 06:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"