ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If Function, looking for formats in values (https://www.excelbanter.com/excel-worksheet-functions/146961-if-function-looking-formats-values.html)

ManBoy86

If Function, looking for formats in values
 
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

If Function, looking for formats in values
 
Try this small macro:

Sub routine()
If Range("A1").Font.FontStyle = "Italic" Then
Range("B1").Value = 0
End If
End Sub

--
Gary''s Student - gsnu200731


"ManBoy86" wrote:

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[_2_]

If Function, looking for formats in values
 
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")




"ManBoy86" wrote:

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.



All times are GMT +1. The time now is 04:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com