How would I write an IF function to check to see if a cell is in Italics and
if it is make another cell = 0
IF(A1???, B1=0) Anyone know what to put where the ?s are?
Thanks.
Gary''s Student - 18 Jun 2007 23:42 GMT
Try this small macro:
Sub routine()
If Range("A1").Font.FontStyle = "Italic" Then
Range("B1").Value = 0
End If
End Sub

Signature
Gary''s Student - gsnu200731
> How would I write an IF function to check to see if a cell is in Italics and
> if it is make another cell = 0
>
> IF(A1???, B1=0) Anyone know what to put where the ?s are?
>
> Thanks.
Jovan Timotijevic - 19 Jun 2007 01:12 GMT
Or try this:
Function IsItalic(mCell As Range) As Boolean
IsItalic = mCell.Font.Italic
End Function
And then type in B1:
=IF(IsItalic(A1),0,"Not italic in A1")
> How would I write an IF function to check to see if a cell is in Italics and
> if it is make another cell = 0
>
> IF(A1???, B1=0) Anyone know what to put where the ?s are?
>
> Thanks.