Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
html tags with a cell
I thought I could use html tags within a cell to bold
cetain words etc. such as My name is <BDan<b and I want to be bold but it does not work. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
html tags with a cell
I never did post a question with this statement - is
there a way to format a part of a cell? -----Original Message----- I thought I could use html tags within a cell to bold cetain words etc. such as My name is <BDan<b and I want to be bold but it does not work. . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
html tags with a cell
Characters Property Example
This example formats the third character in cell A1 on Sheet1 as bold. With Worksheets("Sheet1").Range("A1") .Value = "abcdefg" .Characters(3, 1).Font.Bold = True End With -- John johnf202 at hotmail dot com wrote in message ... I never did post a question with this statement - is there a way to format a part of a cell? -----Original Message----- I thought I could use html tags within a cell to bold cetain words etc. such as My name is <BDan<b and I want to be bold but it does not work. . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
html tags with a cell
You, the man!
Can I apply a format to any string or just to the contents of a range??? Thanks -----Original Message----- Characters Property Example This example formats the third character in cell A1 on Sheet1 as bold. With Worksheets("Sheet1").Range("A1") .Value = "abcdefg" .Characters(3, 1).Font.Bold = True End With -- John johnf202 at hotmail dot com wrote in message ... I never did post a question with this statement - is there a way to format a part of a cell? -----Original Message----- I thought I could use html tags within a cell to bold cetain words etc. such as My name is <BDan<b and I want to be bold but it does not work. . . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
html tags with a cell
Hello dan,
Here is a test code what I wrote(for fun!). :D Try input text in a cell with <b </b Tags. Code: -------------------- Option Explicit 'Written by Colo 18 Dec 2003 Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) BoldWithTag Target End Sub Private Sub BoldWithTag(ByVal Target As Range) Dim c As Range Dim blnFlag As Boolean Dim i As Long, st As Long, ed As Long Dim Start() As Long, Length() As Long If Target.Rows.Count = Rows.Count Then Exit Sub If Target.Columns.Count = Columns.Count Then Exit Sub For Each c In Target With c Do st = InStr(1, .Value, "<b", 1) If st = 0 Then Exit Do ed = InStr(st, .Value, "</b", 1) If ed = 0 Then Exit Do blnFlag = True .Value = Left(.Value, st - 1) & _ Mid(.Value, st + 3, ed - st - 3) & _ Right(.Value, Len(.Value) - ed - 3) i = i + 1 ReDim Preserve Start(1 To i): ReDim Preserve Length(1 To i) Start(i) = st: Length(i) = ed - st - 3 Loop If blnFlag Then For i = LBound(Start) To UBound(Start) c.Characters(Start(i), Length(i)).Font.Bold = True Next End If st = 0: ed = 0: i = 0: Erase Start: Erase Length: blnFlag = False End With Next End Sub -------------------- --- Message posted from http://www.ExcelForum.com/ |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
html tags with a cell
|
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
html tags with a cell
Any object which has the characters property and supports Rich Text
Formatting. For example, the text of cell comments, text in the textbox from the drawing toolbar. -- Regards, Tom Ogilvy wrote in message ... You, the man! Can I apply a format to any string or just to the contents of a range??? Thanks -----Original Message----- Characters Property Example This example formats the third character in cell A1 on Sheet1 as bold. With Worksheets("Sheet1").Range("A1") .Value = "abcdefg" .Characters(3, 1).Font.Bold = True End With -- John johnf202 at hotmail dot com wrote in message ... I never did post a question with this statement - is there a way to format a part of a cell? -----Original Message----- I thought I could use html tags within a cell to bold cetain words etc. such as My name is <BDan<b and I want to be bold but it does not work. . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Remove HTML TAGS | Excel Discussion (Misc queries) | |||
Concatenate & Use HTML tags? | Excel Discussion (Misc queries) | |||
HTML Tags | Excel Worksheet Functions | |||
Remove html markup tags in an EXCEL cell? | Excel Discussion (Misc queries) | |||
Adding HTML tags to cell content | Excel Discussion (Misc queries) |