If Function, looking for formats in values

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Try this small macro:

Sub routine()
If Range("A1").Font.FontStyle = "Italic" Then
Range("B1").Value = 0
End If
End Sub
 
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")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top