Const TARGET_WORD = "プログラム" Dim XL, XLBook, XLRange Set XL = CreateObject("Excel.Application") Set XLBook = XL.workbooks.open("C:\Documents and Settings\デフォルトの名無しさん\デスクトップ\book1.xls") Set XLRange = XLBook.sheets(1).Range("A1")
Dim TargetChr Set TargetChr = XLRange.characters(Instr(XLRange.value, TARGET_WORD),len(TARGET_WORD))
If Instr(XLRange.value, TARGET_WORD) > 0 then TargetChr.Font.ColorIndex = 3 End if
XLBook.save XLBook.close Set XLBook = nothing XL.quit