Hi Jodi,
The only circumstances that I know of that would cause this error in the
code you've shown below is if one of the cells that you are looping through
contains an error value. Try placing a check for an error value prior to
testing for the character like so:
Dim Inrange As Range
Dim rng As Range
Set Inrange = Range("B16,B58,T4,T15,T23,T50")
For Each rng In Inrange.Cells
If Not IsError(rng.Value) Then
If rng.Value = "c" Then
rng.Font.Name = "Wingdings 3"
Else
rng.Font.Name = "Webdings"
End If
End If
Next rng
--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/
* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
"Jodi" wrote in message
...
VBA Specialists,
I am receiving a run time error 13 type mismatch, with this line
highlighted:
If rng.Value = "c" Then
I have a workbook with 27 worksheets. 23 of the 27 are identical and use
the following code:
Private Sub Worksheet_Calculate()
Dim Inrange As Range
Dim rng As Range
Set Inrange = Range("B16,B58,T4,T15,T23,T50")
For Each rng In Inrange.Cells
If rng.Value = "c" Then
rng.Font.Name = "Wingdings 3"
Else
rng.Font.Name = "Webdings"
End If
Next rng
End Sub
4 of the 27 are slightly different and have a different range
Range("B16,B58,T4,T20,T34,T50")
In these 4 worksheets, cells T15 and T23 contain text strings. I know this
is causing the problem, but I want to know is there a way to easily solve
this?
The worksheets still function as designed, but a message box continuously
pops up that must be clicked and is quite annoying. Thanks for any
assistance.
Jodi