LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default VBA Font detail loss

You must set the characters' properties (Bold, Color, Italics, etc.) one
character at a time. Here is a macro that demonstrates the technique...

Sub Test()
Dim J As Long, Start As Long
Dim C As Range, Source As Range, Temp As Range
'.....
'.....
Set Source = Range("B2:B12")
Set Temp = Cells(Cells(Rows.Count, Source.Column).End(xlUp).Row + 1,
Source.Column)
Temp.Value = ActiveCell.Value &
Join(WorksheetFunction.Transpose(Source.Value), "")
For Each C In Union(ActiveCell, Source)
For J = 1 To Len(C.Value)
Start = Start + 1
With Temp.Characters(Start, 1).Font
.Bold = C.Characters(J, 1).Font.Bold
.Color = C.Characters(J, 1).Font.Color
.Italic = C.Characters(J, 1).Font.Italic
End With
Next
Next
Temp.Copy ActiveCell
Temp.Clear
End Sub

Note that I assume your source range of text will *always* be a contiguous
column of values. Making that assumption allows me to concatenate all the
cells in the range using a single statement (see the assignment statement to
the Temp variable).

In my example above, I set the Bold, Color and Italic properties of the
characters. If there are other properties that you might have set in your
characters, then you will have to add them to the lie inside the
With/EndWith block (just follow the structure of the other statements in
it). Also, my code will preserve any font settings you have in the
ActiveCell that you concatenated the source cells with as well.

--
Rick (MVP - Excel)


"Walter Briscoe" wrote in message
...
The following is a slightly simplified extract from some of my code:
POfInterest = ""
For J = 3 To 12
POfInterest = POfInterest & .Cells(J, 2)
Next
End With
ActiveCell = ActiveCell & POfInterest

Font and boldness in .Cells(J, 2) do not get copied to ActiveCell.
How can I ensure such characteristics are copied?
Each field is a mixture of bold and plain text.
--
Walter Briscoe


 
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
hardship letter explaining devastating loss property loss financi carol Excel Discussion (Misc queries) 1 June 12th 09 02:13 PM
grab detail when = 1 jenn Excel Worksheet Functions 0 January 12th 06 09:06 PM
In Detail (what ever works please help) Teerings3[_6_] Excel Programming 3 December 12th 05 09:26 PM
Weight loss line chart to monitor weight loss progress S Fox Charts and Charting in Excel 6 November 8th 05 05:10 PM
Show detail Sunryzz Excel Worksheet Functions 0 May 5th 05 10:56 PM


All times are GMT +1. The time now is 08:30 AM.

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"