Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Character.Font Properties.

Hello peoples,

I have a quick question regarding the cells character
property in particular when you use the .font.fontstyle
property to change the bold properties of in-string text.

I have a cell that has a concatenating value, where the
cell's value is constantly added to when the criteria
matches within a for i loop.

I have some code which locates certain characters within
the newly added content to bold using the Characters
(Start, Length).Font.Fontstyle = "Bold" property.

The only problem is that when the property is set, it
resets the previous bold property to normal. so in effect
only the last value is properly bolded.

When you run the marco recorder, it sets the entire
string length's property toggling where appropriate.

My Question is:

Can I store the cell's formatting properties?
If so how can I access them?

The Output string looks like this (Cell Value):

[SE]-TA <Random Info Atts: 0
[TR]-NS <Random Info Atts: 120
[CP]-QL <Random Info Atts: 0

Where text within the "<" & "" is to be bolded.

Following is the code use to format the portion of the
text to be added.
----------------------------------------------------------
event_conc = "[" & iGroup & "] - " & istate
& " <" & iProg & " " & "Atts: " & iAtt & Chr(10)
iPosStart = InStr(1, event_conc, "<") + 1
iPosEnd = InStr(1, event_conc, "") - 1
rep_out_count_value = ("rep_out_" &
rep_out_count)
rep_out_cur_value = Worksheets("Event
Calendar").Range(rep_out_count_value).Value
strCurrLen = Len(rep_out_cur_value)
With Worksheets("Event Calendar").Range
("rep_out_" & rep_out_count)
.FormulaR1C1 = rep_out_cur_value &
event_conc
.Characters(Start:=strCurrLen +
iPosStart, Length:=strCurrLen + iPosEnd).Font.FontStyle
= "Bold"
End With
----------------------------------------------------------
Is there a way I can store the previos property, if not,
how would one go about re-formatting the text with
multiple inStr("<")'s

Your help is greatly appreciated.


Paul M.

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
How do I use standard notepad (unicode) font for special character Greg Excel Discussion (Misc queries) 2 April 19th 10 04:56 AM
Excel 2007 - Formatting text in cell (character by character) TomC Excel Discussion (Misc queries) 0 January 29th 10 07:25 PM
Excel-Match 1st text character in a string to a known character? bushlite Excel Worksheet Functions 2 January 15th 07 06:36 PM
Excel Font question: Can you overscore a character? DrJoe Excel Discussion (Misc queries) 1 March 30th 05 04:51 PM
Setting Font properties in Code clears Undo list Lorin Excel Programming 2 July 10th 03 09:49 PM


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

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

About Us

"It's about Microsoft Excel"