View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
DavidH56 DavidH56 is offline
external usenet poster
 
Posts: 82
Default Change font to Italic

Thanks Mike for such a fast response,

My mistake, I meant used range because row amounts change each week. Is
there a way to run this in a macro so for my weekly the final report?

Thanks again
--
By persisting in your path, though you forfeit the little, you gain the
great.



"Mike H" wrote:

David,

I didn't understand the range you wanted to work on
cells with red fonts to italics and underline them from cell A2 through Q

so this has a line that will work for A2 - Q100 and another that will work
on the entire used range so use which you prefer.

Right click the sheet tab, view code and paste this in.

Sub Prime_Lending()
ActiveSheet.Range("A2:Q100").SpecialCells(xlCellTy peConstants,
xlTextValues).Select
'ActiveSheet.UsedRange.SpecialCells(xlCellTypeCons tants, xlTextValues).Select
For Each c In Selection
If c.Font.ColorIndex = 3 Then
With c.Font
.FontStyle = "Italic"
.Underline = xlUnderlineStyleSingle
End With
End If
Next
End Sub


Mike

"DavidH56" wrote:

Hi,

Could anyone please let me know how would I programmically to change all
cells with red fonts to italics and underline them from cell A2 through Q
with variable rows?

Thanks in advance.
--
By persisting in your path, though you forfeit the little, you gain the
great.