LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Tagging formatting (cells with mixed formatting)

I need to tag all formatting (bold, itlaic, bold italic, superscript,
underline, etc) in all the cells throughout a worksheet. The way I am doing
it is looping through each cell of the UsedRange and then through each
character of each cell. I am wondering if there is a better/faster way to do
this. Any help would be much appreciated.

Here is what I have so far, I still have to add the Else If statements for
all the other formatting:

For Each myCell In rng.Cells
myBold = myCell.Font.Bold
If myBold = False Then
'do nothing
ElseIf myBold = True Then
'tag whole cell
myCell.Value2 = "<bold" & myCell.Value2 & "</bold"
Else
'we have a mixture so we must loop through each character in cell
myStr = ""
For iCtr = 1 To Len(myCell.Value)
If myCell.Characters(Start:=iCtr, Length:=1).Font.Bold = True Then
myStr = myStr & "<bold" & Mid(myCell.Value, iCtr, 1) & "</bold"
Else
myStr = myStr & Mid(myCell.Value, iCtr, 1)
End If
Next iCtr
myCell.Value = myStr
End If
Next myCell

 
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
condionally formatting based on another cells formatting? Derrick Excel Discussion (Misc queries) 2 July 31st 09 08:05 PM
Formatting cells in a column with conditional formatting? shamor Excel Discussion (Misc queries) 8 May 19th 08 10:11 PM
mixed formatting in same cell with VBA Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 4 November 21st 07 08:47 PM
Conditional Formatting; finding numerical data in mixed text. Philonis Excel Discussion (Misc queries) 2 June 5th 07 11:57 PM
Conditional Formatting in for Cells with Mixed Dates and Text M. A. Newcomb Excel Worksheet Functions 1 May 8th 07 10:05 PM


All times are GMT +1. The time now is 10:42 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"