Last active
April 15, 2018 17:31
-
-
Save ateneva/54af2c739846dcf258f54d492211ece1 to your computer and use it in GitHub Desktop.
Colour cells that have absolute value greater than 1.96
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub ColourCellsonAbsoluteValues() | |
Dim Cell As Range | |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
'written by Angelina Teneva, September 2016 | |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
For Each Cell In Selection | |
Cell.Activate | |
If Cell.Value < 0 Then | |
Cell.Font.Color = RGB(255, 0, 0) 'Makes negative cells red | |
Else | |
Cell.Font.Color = xlNone | |
End If | |
If Abs(Cell.Value) > 1.96 Then Cell.Interior.Color = RGB(0, 255, 204) | |
Next Cell | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment