how to replace format

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

I need to do a replace just so the format is changed. replacing
format in MSWORD is an option, but not in excel....

several cells contain "BYE" in red and a certain font size, some of
the "BYE"s are a different font size... I can't change a range due to
other formats I need to retain...

please email a response... thanks!
 
Why won't this work?

Sub chgfontsize()
For Each c In Selection
If c.Font.Size > 11 Then c.Font.Size = 11
Next
End Sub
 
Don,

that worked great!!! Thanks!

Jim

Don Guillett said:
Why won't this work?

Sub chgfontsize()
For Each c In Selection
If c.Font.Size > 11 Then c.Font.Size = 11
Next
End Sub
 
Don,

I can do some simple macros like that...

The cells with "BYE" are red text

I tried:

Sub chgfontsize()
For Each c In Selection
c.Font.Color = RGB(0, 0, 255)
Next
End Sub

it changed the color for all the cells with numbers, but not the cells
with the text "BYE".... why is that...
 
Probably due to conditional formatting of the cell. This should get both.
===
Font.ColorIndex = 5
Font.Color = RGB(0, 0, 255)
'means the same
-==========

Sub chgfontcolorboth()
On Error Resume Next
For Each c In Selection
c.Font.Color = RGB(0, 0, 255)
c.FormatConditions(1).Font.ColorIndex = 5
Next
End Sub
 
Back
Top