Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default VBA Code help

I think you are going to need VBA code to handle this. Right-click on the
worksheet tab for the sheet where you want this functionality to occur and
select View Code from the popup menu that appears. Then copy/paste the
following into the code window that appeared when you chose to View Code...

Dim InValue As String

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("F4:Y75")) Is Nothing Then
If Target.Value < InValue Then Target.Cells.Interior.Color = vbRed
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
InValue = Target.Value
End Sub

Now, go back to the sheet and change some cells in the range you specified
(also try typing in exactly what was in the cell when you entered it)...
does this do what you wanted?

Rick


"robert morris" wrote in message
...

Could someone help me with an event macro? I would like to have the last
number in a cell I change in each row change color.

Range is F4:Y75. If I change a number in H24, I would like it to change
color. Once a change has been entered in H24, if I then change a number
in
M30 it should change color but H24 would remain as changed.

Confused? So am I.

Bob M.





 
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
Drop Down/List w/Code and Definition, only code entered when selec Spiritdancer Excel Worksheet Functions 2 November 2nd 07 03:57 AM
Convert a Number Code to a Text Code Traye Excel Discussion (Misc queries) 3 April 6th 07 09:54 PM
Code expantion , with code! Arran Excel Discussion (Misc queries) 7 January 14th 07 01:05 AM
Unprotect Code Module in Code Damien Excel Discussion (Misc queries) 2 April 18th 06 03:10 PM
copying vba code to a standard code module 1vagrowr Excel Discussion (Misc queries) 2 November 23rd 05 04:00 PM


All times are GMT +1. The time now is 09:42 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"