Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Change format of single word in cell

Hi,

I need to search and highlight (using bold, change color or whatever
single words in Excel using VBA. With find method, I can find them, bu
when using the replace method, always the complete cell, in which th
word has been found, will be highlight.

Any idea??

Thanks and regards,
Zeno

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Change format of single word in cell

Zenon,

You need to use the characters method once you've found the word:

Dim myStr As String
ActiveCell.Value = "This word is bold and red."
myStr = "word"
With ActiveCell.Characters(Start:=InStr(1, ActiveCell.Value, myStr), _
Length:=Len(myStr)).Font
.FontStyle = "Bold"
.ColorIndex = 3
End With

As for integrating this into your code, we would need to see your code to do
that....

HTH,
Bernie
MS Excel MVP

"Zenon " wrote in message
...
Hi,

I need to search and highlight (using bold, change color or whatever)
single words in Excel using VBA. With find method, I can find them, but
when using the replace method, always the complete cell, in which the
word has been found, will be highlight.

Any idea??

Thanks and regards,
Zenon


---
Message posted from http://www.ExcelForum.com/



Reply
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
How to change format for an individual word in a cell jaysan3 Excel Discussion (Misc queries) 1 August 28th 09 11:03 AM
Add Word and change format Kelvin Excel Discussion (Misc queries) 2 November 24th 05 11:02 PM
How can I copy a list from word into a single cell in excel Hermes Excel Discussion (Misc queries) 3 October 11th 05 03:22 PM
How do I copy data in single cell format to a merged cell format Paul Excel Discussion (Misc queries) 1 June 27th 05 11:00 AM
Conditional format (word change) Onion Excel Worksheet Functions 2 February 8th 05 09:55 PM


All times are GMT +1. The time now is 04:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"