LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default How to fill a column with color in statement

I want to make a code that check in a range of cells if the number entered by
the user is greater that 0, turn that cell in red and send a message to the
user. I tried this code but not work for me.

Dim rng As Range

Set rng = Range("$B$5:$B$11")

If rng 0 Then
MessageBox.Show ("You have an Alert!")
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
End With
End If

End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill Color If Statement Elgee Excel Worksheet Functions 3 August 5th 08 10:13 PM
How do you Control the fill color using an if statement formula? RussCrowder Excel Worksheet Functions 2 June 1st 07 09:31 PM
Changing cell fill color as result of 'if' statement jason Excel Programming 0 August 31st 03 04:51 PM
Changing cell fill color as result of 'if' statement Tom Ogilvy Excel Programming 0 August 31st 03 04:25 PM
Changing cell fill color as result of 'if' statement Phobos Excel Programming 0 August 31st 03 12:41 PM


All times are GMT +1. The time now is 10:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"