Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
condionally formatting based on another cells formatting? | Excel Discussion (Misc queries) | |||
Formatting cells in a column with conditional formatting? | Excel Discussion (Misc queries) | |||
mixed formatting in same cell with VBA | Excel Discussion (Misc queries) | |||
Conditional Formatting; finding numerical data in mixed text. | Excel Discussion (Misc queries) | |||
Conditional Formatting in for Cells with Mixed Dates and Text | Excel Worksheet Functions |