#1
|
|||
|
|||
how to italic the word with vba
dear all
we would like to italic the word "peter" in column e peter is good peter is bad he is peter pet is animal the result will be peter is good peter is bad he is peter pet is animal the vba code dont run , what wrong...? pls help Sub testz() For i = 1 To 100 pos = InStr(Range("e(i)").Value, "peter") With Range("e(i)").Characters(Start:=pos, Length:=5).Font .FontStyle = "Italic" End With Next End Sub Thanks Tom |
#2
|
|||
|
|||
oh the answer is as follows. the problems solved
Sub testz() For i = 1 To 100 pos = InStr(Range("e"&a).Value, "peter") With Range("e"&a).Characters(Start:=pos, Length:=5).Font .FontStyle = "Italic" End With Next a End Sub |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Find text, format part of text in italic | d4okeefe | Word VBA | 18 | 06-30-2022 11:35 PM |
How to "replace" a word with same word but "Italic"? | Jamal NUMAN | Word | 4 | 07-08-2011 04:02 AM |
Can't use Bold and Italic | khmerguy | Word | 3 | 03-31-2011 12:48 PM |
Can't print bold or italic text | cornettd | PowerPoint | 1 | 05-10-2010 10:07 AM |