PC Review


Reply
Thread Tools Rate Thread

Colouring any cell in worksheet with negative value

 
 
Shivam.Shah
Guest
Posts: n/a
 
      16th Feb 2010
Hi all,

I have written the below code for making the cells from column to A to
BB fill with red colour, if they have a negative value in them.

I can't seem to make it work. Any help will be appreciated! Thanks
very much!

Shivam

******************************
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Const ColumnsToCheck As String = "A:BB"
If Not Intersect(Target, Range(ColumnsToCheck)) Is Nothing Then
If Target.Value < 0 Then
Target.Value.Select
Selection.Interior.ColorIndex = 3
End If
End If
End Sub
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      16th Feb 2010
Check your other post.

"Shivam.Shah" wrote:
>
> Hi all,
>
> I have written the below code for making the cells from column to A to
> BB fill with red colour, if they have a negative value in them.
>
> I can't seem to make it work. Any help will be appreciated! Thanks
> very much!
>
> Shivam
>
> ******************************
> Private Sub Worksheet_Change(ByVal Target As Excel.Range)
> Const ColumnsToCheck As String = "A:BB"
> If Not Intersect(Target, Range(ColumnsToCheck)) Is Nothing Then
> If Target.Value < 0 Then
> Target.Value.Select
> Selection.Interior.ColorIndex = 3
> End If
> End If
> End Sub


--

Dave Peterson
 
Reply With Quote
 
Shivam.Shah
Guest
Posts: n/a
 
      16th Feb 2010
Thanks a lot!

On Feb 16, 5:23*pm, Dave Peterson <peter...@verizonXSPAM.net> wrote:
> Check your other post.
>
>
>
> "Shivam.Shah" wrote:
>
> > Hi all,

>
> > I have written the below code for making the cells from column to A to
> > BB fill with red colour, if they have a negative value in them.

>
> > I can't seem to make it work. Any help will be appreciated! Thanks
> > very much!

>
> > Shivam

>
> > ******************************
> > Private Sub Worksheet_Change(ByVal Target As Excel.Range)
> > * * Const ColumnsToCheck As String = "A:BB"
> > * * If Not Intersect(Target, Range(ColumnsToCheck)) Is Nothing Then
> > * * * *If Target.Value < 0 Then
> > * * * * Target.Value.Select
> > * * * * Selection.Interior.ColorIndex = 3
> > * * End If
> > * End If
> > * End Sub

>
> --
>
> Dave Peterson


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Colouring any cell in worksheet with negative value Shivam.Shah Microsoft Excel Discussion 2 16th Feb 2010 11:31 PM
colouring cell KHAN Microsoft Excel Misc 2 2nd Aug 2008 09:42 PM
Automatic cell colouring =?Utf-8?B?Q2hyaXMwMTYyMw==?= Microsoft Excel Worksheet Functions 1 9th May 2006 02:55 PM
colouring a cell andy617 Microsoft Excel Programming 2 11th Jan 2006 03:30 PM
worksheet tab colouring Jeff Etcell Microsoft Excel Programming 4 13th Jul 2004 01:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:30 PM.