View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tony S.[_2_] Tony S.[_2_] is offline
external usenet poster
 
Posts: 60
Default Search and change text color or style only

JLGWhiz, thanks for your prompt reply. However when I type "The dog is large"
in cell B2 and run the macro, the entire sentenced is replaced by the word
"dog" in red. I would need to retain all the contents of the cell and just
bold and/or color the word "dog". Did I enter something wrong?
Tony

"JLGWhiz" wrote:

Sub clrinput()
myText = InputBox("Enter something", "Text")
With Sheets(1).Range("B2")
.Value = myText
.Characters(1, Len(myText)).Font.ColorIndex = 3
End With
End Sub


"Tony S." wrote:

Is it possible to use an input box (or other means of entry) to find and
change the properties of just the inputted text only within any column
selected? I have macros that change the cell color or all the text in the
cell, but I want to just highlight or bold or re-color the word of the text
I'm searching for. (i.e. If a cell contains "INSTALL FASTENERS WITH MPX 5-50
SEALANT PER BAC 4025 METHOD 3." I want to have the option to change the
appearance of just "MPX 5-50" or just "BAC 4025". I'm using Excel 2003.

I've used conditional formatting and been to Chip Pearson's site but can't
find the answer. Any help is greatly appreciated.
Tony