The Financial Function Excel SHOULD Have! Show Zero or Less as RED FONT

The Financial Function Excel SHOULD Have! Zero or Less = RED

So you are going through your balance sheet in Excel and you start manually color coding values that are less than zero. Obviously, they need to be RED, right? Because being in the BLACK means you are good, golden, making moo-la! Being in the RED means you are not doing things right. They need to stand out and say, “Hey! STOP doing that!”. But what if I showed you a way to do this instantly, and for free?

Well, lets get started. Not only that, but if you are not in the mood to read, I’ve got a video tutorial ready for you. How’s that for convenience?

 

The Code and How To Use It

This code is very simple. It works by taking the current selection of cells, looping through each one, and if a cell is equal to or less than zero, it changes the font color to red. That’s it!

Select the values you want to run it on, and click the play button (or assign the macro to a button). Your Done!

How do you get it into Excel? I am glad you asked! So, here’s what you need to do. First things first, press Alt and F11 together to open up the VBA Editor. From there, find the writing that has your workbook’s name (it’s probably ‘Book1’), right-click, insert, and Module. Easy peasy.

Next, copy and paste the VBA code we’ve provided below. Don’t worry, we’ve got your back.

VBA Code

Sub ChangeFontColorZeroOrLessCT()
Dim myRange As Range
Dim cell As Range
Set myRange = Selection ‘ Select the range you want to check

For Each cell In myRange ‘ Loop through each cell in the selected range

If cell.Value <= 0 Then ‘ Check if the cell value is less than 0
cell.Font.Color = vbRed ‘ If it is, change the font color to red
End If
Next cell
End Sub

See? Piece of cake. Now all you have to do is select your range, go back to the VBA Editor, click inside the code you just pasted in and press the green play button at the top. Boom! Now, when you go back to your Excel sheet, any number in your selection that has a value of zero or less is now red!

 

Where this code came from

The code we’re using today is courtesy of our product CelTools. It’s a total game-changer, with over 70+ functions and macros that make Excel easy and fast to use. You definitely want to check it out sometime.

Conclusion

I hope that this has helped you out! If it has let us know! You can leave a comment down below or email our support at support@graytechnical.com.

If you really want to be a champ, download our free trial of CelTools and see how it can really help you out with these really cool functions!

 

Want to get the most out of Excel?

We have other printables as well! Check out these amazing time savers!

Top 80 Functions PDFTop 50 Macro Calls PDF – Top 41 Math Functions