I'm using the following VBA code in excel 2007 to change the font color & bold when a word occurs within a range (rng).
The range is column "L" over 618 rows. On its own it works great! it finds the word in each occurrence within range & changes the properties.
But over time I have created 70+ versions for different words & colorindex. when I run them all at once, I get an "Unresolved Content" error and all my data disappears.
I would love any ideas on how to :
1. fix why multiple subs are causing the "Unresolved Content" errors & deleting my data.
2. Consolidate it into a single sub for many word/colodindex combinations.
Any suggestions??
Thanks!
Pablo
The range is column "L" over 618 rows. On its own it works great! it finds the word in each occurrence within range & changes the properties.
Code:
Sub Bold_Stone()
Dim rng As Range
Dim Cell As Range
Dim start_str As Integer
Dim Tag_str
Tag_str = "STONE"
Set rng = Range("L3:L618")
For Each Cell In rng
start_str = InStr(Cell.Value, Tag_str)
If start_str Then
Application.StatusBar = "Updating " & Tag_str & " Tags ..."
With Cell.Characters(start_str, Len(Tag_str)).Font
.Bold = True
.ColorIndex = 45
End With
End If
Next
End Sub
But over time I have created 70+ versions for different words & colorindex. when I run them all at once, I get an "Unresolved Content" error and all my data disappears.
I would love any ideas on how to :
1. fix why multiple subs are causing the "Unresolved Content" errors & deleting my data.
2. Consolidate it into a single sub for many word/colodindex combinations.
Any suggestions??
Thanks!
Pablo