Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Find and Replace


25 Dec 2010   #1

Windows 7 x64 RC1, Vista Ultimate, XP Pro
 
 
Find and Replace

Excel 2007 - I would like to do a Find and Replace a word and when I do it changes the entire cell by taking the words which have color and truning them black and changing my fonts to one size. How can I just Find and Replace just one word in a cell? Is there anyway I can do a find and have all the words highlighted like when you do a find on the Internet?


My System SpecsSystem Spec
.

25 Dec 2010   #2

Windows 7 Professional 32bit Sp1
 
 

Quote   Quote: Originally Posted by lostsoul62 View Post
Excel 2007 - I would like to do a Find and Replace a word and when I do it changes the entire cell by taking the words which have color and truning them black and changing my fonts to one size. How can I just Find and Replace just one word in a cell? Is there anyway I can do a find and have all the words highlighted like when you do a find on the Internet?
I'm not sure if you can highlight the word but you can change the color of the font, shade the cell etc. Find & select, replace, format, text & fill.
My System SpecsSystem Spec
25 Dec 2010   #3

Microsoft Community Contributor Award Recipient

Windows 7 SP1, Home Premium, 64-bit
 
 

Not clear from your explanation what you are trying to do. Find and replace has some options as you see when you go the that window.

More generally, have you looked into "conditional formatting"??

I use it to turn certain cells red or green, depending on whether the value in those cells is greater or less than a particular value found elsewhere in the worksheet. I think it can control font and font size as well, but I use it only for colors.

I'd assume you could force a cell to have a 24 point New Times Roman bolded font with a yellow background if the first word in the cell begins with J, etc if that is what you wanted. Conditional formatting has a lot of control. You make a series of "rules" and if what is in the cell matches the rule, the formatting changes. If not, it doesn't.
My System SpecsSystem Spec
.


26 Dec 2010   #4

Windows 7 x64 RC1, Vista Ultimate, XP Pro
 
 
The word and not the cell

I don't want to turn the cell into anything I want to turn a word in the cell to something different. In my case I want to turn a thousand words in a thousand cells which will be one word per cell that I am try to change ONLY. Is there anyway I can do this?
My System SpecsSystem Spec
06 Jan 2011   #5

Windows 7 Enterprise x64
 
 

By chance, I came across a possible answer to this difficult problem (it's at Superscripts in Find and Replace (Microsoft Excel)).

That specific example talks about making one character in a cell superscript, but the macro they give could be modified to alter just one word. The limitation would be that the word would need to be the same, and in the same place, in every cell. The macro they give is:

Sub DoConvert()
Dim c As Range

For Each c In Selection.Cells

If c.Value = "yd2" Then
c.Characters(3, 1).Font.Superscript = True
End If
Next
End Sub


Say you had an Excel worksheet with thousands of cells, about a thousand of which contain the string "SevenForums is great". If you wanted to change the word "great" to bold, making those cells say "SevenForums is great", you could run this macro:

Sub DoConvert()
Dim c As Range

For Each c In Selection.Cells

If c.Value = "SevenForums is great" Then
c.Characters(16, 5).Font.Bold = True
End If
Next
End Sub


The (16, 5) bit tells the macro to go to the 16th character in the string, and to do the conversion on 5 characters. I've tried it and it does work - hopefully it will solve your problem. If you need any help with tweaking it, let us know
My System SpecsSystem Spec
06 Jan 2011   #6

Several, including Windows 7 x64 Ultimate
 
 

My System SpecsSystem Spec
07 Oct 2011   #7

windows xp
 
 

I had the same problem and the solution presented here and elsewhere didn't quite solve what I looking for (the above solution only matches on the whole text string, as opposed to a substring and the other only formatted a substring in one cell), so I combined the two:

Sub Bold_substring()
Dim c As Range
Dim Start As Long
Dim TargetWord As String



For Each c In Selection.Cells

Start = 0
TargetWord = "substring I'm looking for"
Do
Start = InStr(Start + 1, c.Text, TargetWord)
If Start < 1 Then Exit Do
With c.Characters(Start, Len(TargetWord)).Font

If IsNull(FontBold) = False Then .Bold = True

End With

Loop

Next
End Sub
My System SpecsSystem Spec
Reply

 Find and Replace




Thread Tools




Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 04:53 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33