macro color change

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

Guest

I have an inspection report that shows my out of tolerance numbers in red.
Problem is, when I print it in black and white, the out of tolerance numbers
don't stand out. So I've been trying to edit the code so the red numbers are
in arial black and bold and having no success. Here is the code:

'Perform Colorization
*****************************************************************
' ** Initialize Variables
TCount = 0
TTOffset = 11 + (2 * Count)
ISOffset = (6 + (2 * Count)) * -1

' ** Position to S1
Range("A15").Activate 'Activate First Dimension Set
ActiveCell.Offset(0, TTOffset).Activate

oldStatusBar = Application.DisplayStatusBar
Application.DisplayStatusBar = True
Application.StatusBar = "Please be patient, Colorization In Process..."

Do Until ActiveCell.Value = ""
Do Until TCount = Count
If ActiveCell.Value = 1 Then
ActiveCell.Offset(0, ISOffset).Font.ColorIndex = 1
Else
ActiveCell.Offset(0, ISOffset).Font.ColorIndex = 3
End If
TCount = TCount + 1
ActiveCell.Offset(0, 1).Activate
Loop
ActiveCell.Offset(1, (TCount * -1)).Activate
TCount = 0
Loop

Application.StatusBar = False
Application.DisplayStatusBar = oldStatusBar

'Enable Screen Updating
*****************************************************************
Application.ScreenUpdating = True

Range("A15").Activate 'Set Focus on A13
End Sub
 
With ActiveCell.Offset(0, ISOffset).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 12
.ColorIndex = xlAutomatic
End With
 
Do you just need to change this


If ActiveCell.Value = 1 Then
ActiveCell.Offset(0, ISOffset).Font.ColorIndex = 1
Else
ActiveCell.Offset(0, ISOffset).Font.ColorIndex = 3
End If

to this

If ActiveCell.Value = 1 Then
ActiveCell.Offset(0, ISOffset).Font.ColorIndex = 1
Else
With ActiveCell.Offset(0, ISOffset).Font
.ColorIndex = 3
.Name = "Arial"
.Bold = True
End WIth
End If


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Tried it and it does bold my numbers in red, but it also bolds my deviations,
which is the next line below. On the bright side, my deviations remain black
 
Back
Top