HOW TO USE REPLACE OR CREATE A MACRO TO HIGHTLIGHT THE NEGATIVE VA

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

Guest

I HAVE COLUMNS FULL OF MIX NUMBERS. I WAOULD LIKE TO HIGHTLIGHT THE NEGATIVE
NUMBERS BY RUNNING THE MACRO. THE REPLACE DOESNT HAVE A LOOK IN VALUE CHOICE.
CAN SOMEONE PLEASE HELP ME WITH THIS??
 
I HAVE COLUMNS FULL OF MIX NUMBERS. I WAOULD LIKE TO HIGHTLIGHT THE NEGATIVE
NUMBERS BY RUNNING THE MACRO. THE REPLACE DOESNT HAVE A LOOK IN VALUE CHOICE.
CAN SOMEONE PLEASE HELP ME WITH THIS??

Varsang,

You can look into doing conditional formatting in the Excel
application.

In VBA you can do something like the following (provided that your
data is contiguous).

Option Explicit

Sub colorMacro()
Dim a
Dim counter

counter = Range("a1").CurrentRegion.Rows.Count

For a = 1 To counter
If Range("a" & a).Value < 0 Then
Range("a" & a).Interior.ColorIndex = 3
End If
Next

End Sub

Matt
 

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