Find and Replace

lostsoul62

Banned
Local time
7:32 PM
Messages
380
Location
AZ
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 Computer

OS
Windows 7 x64 RC1, Vista Ultimate, XP Pro
CPU
AMD 955
Memory
4 gigs - 1333
Graphics Card(s)
5750
Monitor(s) Displays
i-inc 28"
Screen Resolution
1920x1200
Hard Drives
2 SATA2 750 GB - 1 SATA2 1TB - 1 SATA3 1TB - 1 USB3 2TB - 1 USB3 500 GB, SSD 60 GB
Internet Speed
7 Megs
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 Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell Vostro 3558 (Laptop)
OS
Windows 7 Professional 64bit
Motherboard
Dell
Memory
8GB
Graphics Card(s)
Intel HD Graphics, NVIDIA GeForce
Screen Resolution
1366 x 768
Antivirus
Avira Free, MalwareBytes AntiMalware Pro
Browser
Chrome
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 Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Ignatz Special; 4 speed manual gearbox; factory air conditioning; one of one
OS
Windows 7 Home Premium SP1, 64-bit
CPU
Intel Skylake i5-6600K, not overclocked
Motherboard
AsRock Z170M Extreme 4, micro ATX
Memory
8 GB HyperX DDR4-2666 (2 x 4 GB)
Graphics Card(s)
none; graphics are integrated on CPU
Sound Card
onboard: Realtek ALC1150; external: USB Behringer UF0-202
Monitor(s) Displays
Dell S2340M 23 inch IPS
Screen Resolution
1600 x 900
Hard Drives
System: Crucial MX100 series SSD, 128 GB;
Data: Samsung Spinpoint 103SJ, 1 TB;
Backup: WD Caviar Green WD30EZRX-00D8PB0, 3 TB
PSU
Rosewill SilentNight 500 watt fanless, semi-modular
Case
Antec Solo II
Cooling
Noctua NH-U12S; Noctua F12 intake, Noctua S12A exhaust
Keyboard
Microsoft 200 6JH-00001 USB
Mouse
Dell or Microsoft optical wired; USB
Antivirus
Microsoft Security Essentials and Malwarebytes Premium
Browser
Pale Moon
Other Info
All fans PWM; speeds at idle: CPU circa 500 rpm; intake circa 600 rpm; exhaust circa 600 rpm; CPU temps 27 idle and 47 C load in a warm room (27 C/81 F) when running Intel Extreme Tuning Utility stress test.
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 Computer

OS
Windows 7 x64 RC1, Vista Ultimate, XP Pro
CPU
AMD 955
Memory
4 gigs - 1333
Graphics Card(s)
5750
Monitor(s) Displays
i-inc 28"
Screen Resolution
1920x1200
Hard Drives
2 SATA2 750 GB - 1 SATA2 1TB - 1 SATA3 1TB - 1 USB3 2TB - 1 USB3 500 GB, SSD 60 GB
Internet Speed
7 Megs
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 Computer

Computer Manufacturer/Model Number
Custom
OS
Windows 7 Enterprise x64
CPU
Intel i7 920
Motherboard
Asus P6T Deluxe v2
Memory
6 GB
Graphics Card(s)
nVidia GTX260 + nVidia 3D
Sound Card
Onboard
Monitor(s) Displays
Samsung SyncMaster 2233RZ
Screen Resolution
1680 x 1050
Hard Drives
1 x 64GB SSD primary
2 x 1 TB (mirrored)
PSU
700W
Other Info
Edimax 802.11n Wireless PCI Card
Netgear DG834G router
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 Computer

OS
windows xp
Back
Top