Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Combining Cells | Excel Discussion (Misc queries) | |||
Need help with combining cells to one | Excel Discussion (Misc queries) | |||
Combining and merging lines | Excel Discussion (Misc queries) | |||
combining 3D with lines | Charts and Charting in Excel | |||
combining cells | Excel Discussion (Misc queries) |